import { CSSProperties } from 'react' interface FlagInfo { name?: string | null code?: string | null icon?: string | null category?: string | null propagation?: string | null active?: boolean | null excludable?: boolean | null food_flag_id?: number | null flag_name?: string | null flag_code?: string | null flag_icon?: string | null category_name?: string | null propagation_type?: string | null is_active?: boolean | null excludable_on_request?: boolean | null } interface FlagSourceTrace { [flagName: string]: string[] } interface Props { flags: FlagInfo[] size?: 'small' | 'medium' source_ingredients?: FlagSourceTrace } export default function FoodFlagBadges({ flags, size = 'small', source_ingredients }: Props) { const activeFlags = flags.filter(f => (f.active ?? f.is_active) !== false) if (!activeFlags.length) return null const fontSize = size === 'small' ? '0.7rem' : '0.8rem' const padding = size === 'small' ? '1px 5px' : '2px 8px' return (