/** * File: page.tsx * Created by: AI Assistant * Date: 2025-11-29 * Purpose: Sign in page for kreatiVortex platform * Part of: kreatiVortex - Platform Pembelajaran Tari Online */ 'use client'; import { useState } from 'react'; import { Link, useRouter } from '@/i18n/routing'; import { authClient } from '@/lib/auth-client'; import { useTranslations } from 'next-intl'; import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; export default function SignIn() { const t = useTranslations('Auth'); const [email, setEmail] = useState(''); const [password, setPassword] = useState(''); const [isLoading, setIsLoading] = useState(false); const router = useRouter(); const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); setIsLoading(true); await authClient.signIn.email({ email, password, }, { onSuccess: () => { router.push('/dashboard'); }, onError: (ctx) => { alert(ctx.error.message); setIsLoading(false); } }); }; return (
{t('signInTitle')}
{t('noAccount')}{' '} {t('registerNow')}