import { zodResolver } from '@hookform/resolvers/zod' import { createFileRoute, useNavigate } from '@tanstack/react-router' import { MonitorIcon, MoonIcon, SunIcon } from 'lucide-react' import { useForm } from 'react-hook-form' import { toast } from 'sonner' import { z } from 'zod' import { AppBadgeCard } from '@/components/settings/app-badge-card' import { PasskeysCard } from '@/components/settings/passkeys-card' import { type Theme, useTheme } from '@/components/theme-provider' import { Button } from '@/components/ui/button' import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card' import { Field, FieldDescription, FieldError, FieldGroup, FieldLabel } from '@/components/ui/field' import { Input } from '@/components/ui/input' import { appVersion } from '@/lib/app-version' import { authClient, signOut, useSession } from '@/lib/auth-client' export const Route = createFileRoute('/_authenticated/settings')({ component: SettingsPage, }) function SettingsPage() { const navigate = useNavigate() return (
Versión {appVersion.commit} ·{' '} {builtAtFormat.format(appVersion.builtAt)}
) } const profileSchema = z.object({ name: z.string().trim().min(1, 'El nombre es obligatorio').max(80, 'Máximo 80 caracteres'), }) type ProfileValues = z.infer