'use client'; import type React from 'react'; import { useState } from 'react'; import { Button } from '@/components/ui/button'; import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, } from '@/components/ui/command'; import { Popover, PopoverContent, PopoverTrigger, } from '@/components/ui/popover'; import { cn } from '@/lib/utils'; import { Check, ChevronDown, User, Bell, Calendar, Shield, Palette, } from 'lucide-react'; interface SettingsSection { label: string; value: string; description: string; icon: React.ComponentType<{ className?: string }>; } interface SettingsDropdownProps { currentSection: string; onSectionChange: (section: string) => void; className?: string; } const settingsSections: SettingsSection[] = [ { label: 'Account', value: 'general', description: 'Manage your account details and preferences', icon: User, }, { label: 'Notifications', value: 'notifications', description: 'Choose how you want to be notified', icon: Bell, }, { label: 'Calendar', value: 'calendarAvailability', description: 'Manage calendar display, availability and iCal integration', icon: Calendar, }, { label: 'Privacy', value: 'sharingPrivacy', description: 'Control who can see your calendar and book time with you', icon: Shield, }, { label: 'Appearance', value: 'appearance', description: 'Customize the look and feel of the application', icon: Palette, }, ]; export function SettingsDropdown({ currentSection, onSectionChange, className, }: SettingsDropdownProps) { const [open, setOpen] = useState(false); const currentSectionData = settingsSections.find( (section) => section.value === currentSection, ); const CurrentIcon = currentSectionData?.icon || User; const handleSelect = (value: string) => { onSectionChange(value); setOpen(false); }; return (
No settings found. {settingsSections.map((section) => { const Icon = section.icon; return ( handleSelect(section.value)} className='flex items-center justify-between p-3' >
{section.label}

{section.description}

); })}
); }