Files
accounts-manager-web/components/shared/owner-selector.tsx
Your Name 0b95ca36f1 Initial project setup with Next.js accounts manager
- Set up Next.js project structure
- Added UI components and styling
- Configured package dependencies
- Added feature documentation

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-23 01:40:14 +08:00

45 lines
1.1 KiB
TypeScript

"use client";
import { StatsSelect } from './stats-select';
import { StatsOverview } from '@/lib/types';
import { useStatsData } from '@/lib/hooks/use-stats-data';
interface OwnerSelectorProps {
value: string;
onValueChange: (value: string) => void;
stats: StatsOverview | null;
showNoneOption?: boolean;
noneOptionLabel?: string;
placeholder?: string;
inputPlaceholder?: string;
className?: string;
disabled?: boolean;
}
export function OwnerSelector({
value,
onValueChange,
stats,
showNoneOption = false,
noneOptionLabel = "不修改",
placeholder = "选择所有者",
inputPlaceholder = "或直接输入所有者ID",
className,
disabled = false
}: OwnerSelectorProps) {
const { owners } = useStatsData(stats);
return (
<StatsSelect
value={value}
onValueChange={onValueChange}
placeholder={placeholder}
inputPlaceholder={inputPlaceholder}
items={owners}
showNoneOption={showNoneOption}
noneOptionLabel={noneOptionLabel}
className={className}
disabled={disabled}
/>
);
}