import { Shield, CheckCircle2, Users } from 'lucide-react';
import { Badge } from '@/components/ui/badge';
import type { TrustFilterLevel } from '@/lib/trustFilter';
import { Button } from '@/components/ui/button';
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuCheckboxItem,
DropdownMenuTrigger,
DropdownMenuLabel,
DropdownMenuSeparator,
} from '@/components/ui/dropdown-menu';
import { cn } from '@/lib/utils';
import { useTranslation } from '@/contexts/language';
interface TrustFilterProps {
value: TrustFilterLevel;
onChange: (value: TrustFilterLevel) => void;
className?: string;
compact?: boolean;
}
const TRUST_LEVELS = [
{
value: 'all' as const,
labelKey: 'chromeUi.trust.all',
descKey: 'chromeUi.trust.allDesc',
icon: Users,
color: 'text-gray-400',
},
{
value: 'verified' as const,
labelKey: 'chromeUi.trust.verified',
descKey: 'chromeUi.trust.verifiedDesc',
icon: CheckCircle2,
color: 'text-green-500',
},
{
value: 'trusted' as const,
labelKey: 'chromeUi.trust.trusted',
descKey: 'chromeUi.trust.trustedDesc',
icon: Shield,
color: 'text-yellow-500',
},
{
value: 'following' as const,
labelKey: 'chromeUi.trust.following',
descKey: 'chromeUi.trust.followingDesc',
icon: CheckCircle2,
color: 'text-green-500',
},
];
export function TrustFilter({ value, onChange, className, compact = false }: TrustFilterProps) {
const { t } = useTranslation();
const currentLevel = TRUST_LEVELS.find((l) => l.value === value) || TRUST_LEVELS[0];
const Icon = currentLevel.icon;
if (compact) {
return (
{t(level.descKey)}