import { login } from '@/routes'; import { store } from '@/routes/register'; import { Form, Head, router } from '@inertiajs/react'; import { useCallback, useEffect } from 'react'; import InputError from '@/components/input-error'; import TextLink from '@/components/text-link'; import { Button } from '@/components/ui/button'; import { Input } from '@/components/ui/input'; import { Label } from '@/components/ui/label'; import { Spinner } from '@/components/ui/spinner'; import AuthLayout from '@/layouts/auth-layout'; import { transactionSyncService } from '@/services/transaction-sync'; interface RegisterProps { hideAuthButtons?: boolean; } export default function Register({ hideAuthButtons = false }: RegisterProps) { useEffect(() => { if (hideAuthButtons) { router.visit(login()); } }, [hideAuthButtons]); const handleBeforeSubmit = useCallback(async () => { await transactionSyncService.clearAll(); return true; }, []); if (hideAuthButtons) { return null; } return (
{({ processing, errors }) => ( <>
Already have an account?{' '} Log in
)}
); }