diff --git a/src/components/SetStatusDialog.tsx b/src/components/SetStatusDialog.tsx index 05e5f73..196747b 100644 --- a/src/components/SetStatusDialog.tsx +++ b/src/components/SetStatusDialog.tsx @@ -18,6 +18,7 @@ import { useSkateSpots } from '@/hooks/useSkateSpots'; import { useUserStatus, useSetUserStatus, useClearUserStatus, SKATING_STATUSES, type SkatingStatusId } from '@/hooks/useUserStatus'; import type { SkateSpot } from '@/lib/types'; import { cn } from '@/lib/utils'; +import { useTranslation } from '@/contexts/language'; import { Loader2, MapPin, Clock, X, Zap, Search } from 'lucide-react'; interface SetStatusDialogProps { @@ -31,6 +32,7 @@ export function SetStatusDialog({ onOpenChange, preselectedSpot, }: SetStatusDialogProps) { + const { t } = useTranslation(); const { user } = useCurrentUser(); const { toast } = useToast(); const { data: currentStatus } = useUserStatus(user?.pubkey); @@ -70,8 +72,8 @@ export function SetStatusDialog({ }); toast({ - title: 'Status updated!', - description: 'Your skating status is now visible to others.', + title: t('toastsUi.statusUpdated'), + description: t('toastsUi.statusUpdatedDesc'), }); onOpenChange(false); // Reset form @@ -80,7 +82,7 @@ export function SetStatusDialog({ if (!preselectedSpot) setLinkedSpot(null); } catch (error) { toast({ - title: 'Failed to set status', + title: t('toastsUi.statusFailed'), description: error instanceof Error ? error.message : 'Something went wrong', variant: 'destructive', }); @@ -91,13 +93,13 @@ export function SetStatusDialog({ try { await clearStatus.mutateAsync(); toast({ - title: 'Status cleared', - description: 'Your status has been removed.', + title: t('toastsUi.statusCleared'), + description: t('toastsUi.statusClearedDesc'), }); onOpenChange(false); } catch (error) { toast({ - title: 'Failed to clear status', + title: t('toastsUi.statusClearFailed'), description: error instanceof Error ? error.message : 'Something went wrong', variant: 'destructive', }); @@ -170,7 +172,7 @@ export function SetStatusDialog({ {/* Quick Status Options */}
{status.label}
+{t(status.labelKey)}