diff --git a/src/components/ContentGenerator/ContentGenerator.tsx b/src/components/ContentGenerator/ContentGenerator.tsx index 8b3664939..f10727bcc 100644 --- a/src/components/ContentGenerator/ContentGenerator.tsx +++ b/src/components/ContentGenerator/ContentGenerator.tsx @@ -6,14 +6,8 @@ import { type LucideIcon, } from 'lucide-react'; import { useId, useState } from 'react'; -import { cn } from '../../lib/classname'; -import { - Select, - SelectContent, - SelectItem, - SelectTrigger, - SelectValue, -} from '../Select'; +import { FormatItem } from './FormatItem'; +import { GuideOptions } from './GuideOptions'; const allowedFormats = ['course', 'guide', 'roadmap'] as const; type AllowedFormat = (typeof allowedFormats)[number]; @@ -95,89 +89,3 @@ export function ContentGenerator() { ); } - -type FormatItemProps = { - label: string; - onClick: () => void; - icon: LucideIcon; - isSelected: boolean; -}; - -function FormatItem(props: FormatItemProps) { - const { label, onClick, icon: Icon, isSelected } = props; - - return ( - - ); -} - -function GuideOptions() { - const [depth, setDepth] = useState('essentials'); - const depthSelectId = useId(); - - const depthOptions = [ - { - label: 'Essentials', - value: 'essentials', - description: 'Just the code concepts', - }, - { - label: 'Detailed', - value: 'detailed', - description: 'In-depth explanation', - }, - { - label: 'Complete', - value: 'complete', - description: 'Cover the topic fully', - }, - ]; - - const selectedDepth = depthOptions.find((option) => option.value === depth); - - return ( -
- - -
- ); -} diff --git a/src/components/ContentGenerator/FormatItem.tsx b/src/components/ContentGenerator/FormatItem.tsx new file mode 100644 index 000000000..2e3209bce --- /dev/null +++ b/src/components/ContentGenerator/FormatItem.tsx @@ -0,0 +1,29 @@ +import { type LucideIcon } from 'lucide-react'; +import { cn } from '../../lib/classname'; + +type FormatItemProps = { + label: string; + onClick: () => void; + icon: LucideIcon; + isSelected: boolean; +}; + +export function FormatItem(props: FormatItemProps) { + const { label, onClick, icon: Icon, isSelected } = props; + + return ( + + ); +} diff --git a/src/components/ContentGenerator/GuideOptions.tsx b/src/components/ContentGenerator/GuideOptions.tsx new file mode 100644 index 000000000..45b187b56 --- /dev/null +++ b/src/components/ContentGenerator/GuideOptions.tsx @@ -0,0 +1,67 @@ +import { useId, useState } from 'react'; +import { + Select, + SelectContent, + SelectItem, + SelectTrigger, + SelectValue, +} from '../Select'; + +export function GuideOptions() { + const [depth, setDepth] = useState('essentials'); + const depthSelectId = useId(); + + const depthOptions = [ + { + label: 'Essentials', + value: 'essentials', + description: 'Just the code concepts', + }, + { + label: 'Detailed', + value: 'detailed', + description: 'In-depth explanation', + }, + { + label: 'Complete', + value: 'complete', + description: 'Cover the topic fully', + }, + ]; + + const selectedDepth = depthOptions.find((option) => option.value === depth); + + return ( +
+ + +
+ ); +}