import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger } from '@/components/ui/alert-dialog' import { Button, buttonVariants } from '@/components/ui/button' import { useUserTrust } from '@/providers/UserTrustProvider' import { VariantProps } from 'class-variance-authority' import { Shield, ShieldCheck } from 'lucide-react' import { useTranslation } from 'react-i18next' export default function HideUntrustedContentButton({ type, size = 'icon' }: { type: 'interactions' | 'notifications' size?: VariantProps['size'] }) { const { t } = useTranslation() const { hideUntrustedInteractions, hideUntrustedNotifications, updateHideUntrustedInteractions, updateHideUntrustedNotifications } = useUserTrust() const enabled = type === 'interactions' ? hideUntrustedInteractions : hideUntrustedNotifications const updateEnabled = type === 'interactions' ? updateHideUntrustedInteractions : updateHideUntrustedNotifications const typeText = t(type) return ( {enabled ? t('Show untrusted {type}', { type: typeText }) : t('Hide untrusted {type}', { type: typeText })} {enabled ? t('Currently hiding {type} from untrusted users.', { type: typeText }) : t('Currently showing all {type}.', { type: typeText })}{' '} {t('Trusted users include people you follow and people they follow.')}{' '} {enabled ? t('Click continue to show all {type}.', { type: typeText }) : t('Click continue to hide {type} from untrusted users.', { type: typeText })} {t('Cancel')} updateEnabled(!enabled)}> {t('Continue')} ) }