import { ArrowUpDown, Clock, TrendingUp, MapPin, Zap, Shield } from 'lucide-react'; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select'; import { cn } from '@/lib/utils'; import { useTranslation } from '@/contexts/language'; export type SortOption = | 'recent' | 'trust' | 'proximity' | 'popular' | 'zaps'; interface SortDropdownProps { value: SortOption; onChange: (value: SortOption) => void; className?: string; showProximity?: boolean; // Only show if geolocation available contentType?: 'spots' | 'events' | 'coaches' | 'generic'; } const SORT_OPTIONS = { recent: { labelKey: 'chromeUi.sort.recent', descKey: 'chromeUi.sort.recentDesc', icon: Clock, }, trust: { labelKey: 'chromeUi.sort.trust', descKey: 'chromeUi.sort.trustDesc', icon: Shield, }, proximity: { labelKey: 'chromeUi.sort.proximity', descKey: 'chromeUi.sort.proximityDesc', icon: MapPin, }, popular: { labelKey: 'chromeUi.sort.popular', descKey: 'chromeUi.sort.popularDesc', icon: TrendingUp, }, zaps: { labelKey: 'chromeUi.sort.zaps', descKey: 'chromeUi.sort.zapsDesc', icon: Zap, }, }; export function SortDropdown({ value, onChange, className, showProximity = false, }: SortDropdownProps) { const { t } = useTranslation(); const selectedOption = SORT_OPTIONS[value]; const Icon = selectedOption.icon; // Determine which sort options to show based on content type const availableOptions: SortOption[] = ['recent', 'trust']; if (showProximity) { availableOptions.push('proximity'); } // Popular sorting available for all content types availableOptions.push('popular'); // Zaps available for all content availableOptions.push('zaps'); return ( ); }