Files
neta/app/login/page.tsx
T
Poyraz 24fcdf9a77 feat: add new UI components and improve existing ones
- Introduced `Field` and `Label` components for better form handling.
- Refactored `Input` and `Textarea` components to use forward refs and improved styling.
- Updated `PendingSubmitButton` to use the new `Button` component.
- Enhanced `Skeleton` component for better layout handling.
- Revamped `Toast` component to support live regions and improved accessibility.
- Updated sidebar configuration to use typed icons.
- Added phase 3 UI boundary checks to prevent usage of deprecated imports.
- Implemented new authentication action handler for better cookie management.
- Improved setup logic for freelancer accounts with repair functionality.
2026-07-10 22:47:02 +03:00

88 lines
2.9 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { login } from "@/app/login/actions";
import { AuthPageShell } from "@/components/auth/auth-page-shell";
import { ErrorToaster } from "@/components/error-toaster";
import { LockKeyhole, LogIn, Mail } from "lucide-react";
import Link from "next/link";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/field";
import { SubmitButton } from "@/components/auth/submit-button";
export default async function LoginPage({
searchParams,
}: {
searchParams: Promise<{ [key: string]: string | string[] | undefined }>;
}) {
const resolvedParams = await searchParams;
const error = resolvedParams?.error;
const message = resolvedParams?.message;
return (
<>
{error && message && <ErrorToaster message={String(message)} />}
<AuthPageShell
title="Giriş yap"
description="Neta çalışma alanına erişmek için hesabına giriş yap."
form={
<form className="space-y-6">
<div className="space-y-4">
<div className="space-y-2">
<Label htmlFor="email" className="flex items-center gap-2">
<Mail className="h-4 w-4 text-muted-foreground" />
E-posta
</Label>
<Input
id="email"
name="email"
type="email"
placeholder="ornek@mail.com"
required
className="h-11"
/>
</div>
<div className="space-y-2">
<div className="flex items-center justify-between gap-3">
<Label htmlFor="password" className="flex items-center gap-2">
<LockKeyhole className="h-4 w-4 text-muted-foreground" />
Şifre
</Label>
<Link
href="/forgot-password"
className="text-sm font-medium text-primary transition-colors hover:text-primary-hover"
>
Şifremi unuttum
</Link>
</div>
<Input
id="password"
name="password"
type="password"
required
className="h-11"
/>
</div>
</div>
<SubmitButton formAction={login} className="h-11 w-full gap-2" pendingText="Giriş yapılıyor...">
<LogIn className="h-4 w-4" />
Giriş yap
</SubmitButton>
</form>
}
secondaryAction={null}
footer={
<div className="text-center text-sm">
İlk kurulumu yapmadın mı?{" "}
<Link
href="/register"
className="font-medium text-primary transition-colors hover:text-primary-hover"
>
Admin hesabını oluştur
</Link>
</div>
}
/>
</>
);
}