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>
This commit is contained in:
45
components/shared/platform-selector.tsx
Normal file
45
components/shared/platform-selector.tsx
Normal file
@@ -0,0 +1,45 @@
|
||||
"use client";
|
||||
|
||||
import { StatsSelect } from './stats-select';
|
||||
import { StatsOverview } from '@/lib/types';
|
||||
import { useStatsData } from '@/lib/hooks/use-stats-data';
|
||||
|
||||
interface PlatformSelectorProps {
|
||||
value: string;
|
||||
onValueChange: (value: string) => void;
|
||||
stats: StatsOverview | null;
|
||||
showNoneOption?: boolean;
|
||||
noneOptionLabel?: string;
|
||||
placeholder?: string;
|
||||
inputPlaceholder?: string;
|
||||
className?: string;
|
||||
disabled?: boolean;
|
||||
}
|
||||
|
||||
export function PlatformSelector({
|
||||
value,
|
||||
onValueChange,
|
||||
stats,
|
||||
showNoneOption = false,
|
||||
noneOptionLabel = "不修改",
|
||||
placeholder = "选择平台",
|
||||
inputPlaceholder = "或直接输入平台名称",
|
||||
className,
|
||||
disabled = false
|
||||
}: PlatformSelectorProps) {
|
||||
const { platforms } = useStatsData(stats);
|
||||
|
||||
return (
|
||||
<StatsSelect
|
||||
value={value}
|
||||
onValueChange={onValueChange}
|
||||
placeholder={placeholder}
|
||||
inputPlaceholder={inputPlaceholder}
|
||||
items={platforms}
|
||||
showNoneOption={showNoneOption}
|
||||
noneOptionLabel={noneOptionLabel}
|
||||
className={className}
|
||||
disabled={disabled}
|
||||
/>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user