2025-02-21 16:44:51 +07:00
|
|
|
// import { EyeIcon, EyeOffIcon } from 'lucide-react'
|
2025-02-22 17:14:33 +08:00
|
|
|
import { useState, type Dispatch, type SetStateAction } from 'react'
|
2025-02-21 16:44:51 +07:00
|
|
|
|
2025-02-22 15:15:04 +07:00
|
|
|
import { EyeIcon } from '~/components/icons/eye'
|
2025-02-23 19:43:45 +08:00
|
|
|
import { Button } from '~/components/ui/button'
|
2025-02-22 17:14:33 +08:00
|
|
|
|
|
|
|
|
type TProperties = {
|
|
|
|
|
setIsRegisterOpen: Dispatch<SetStateAction<boolean>>
|
|
|
|
|
setIsLoginOpen: Dispatch<SetStateAction<boolean>>
|
2025-02-22 21:17:56 +07:00
|
|
|
setIsForgetOpen: Dispatch<SetStateAction<boolean>>
|
2025-02-22 17:14:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const FormLogin = (properties: TProperties) => {
|
2025-02-22 21:17:56 +07:00
|
|
|
const { setIsRegisterOpen, setIsLoginOpen, setIsForgetOpen } = properties
|
2025-02-21 16:44:51 +07:00
|
|
|
const [showPassword, setShowPassword] = useState(false)
|
|
|
|
|
|
|
|
|
|
return (
|
2025-02-22 15:17:46 +08:00
|
|
|
<div className="flex items-center justify-center">
|
2025-02-22 15:15:04 +07:00
|
|
|
<div className="w-full max-w-md">
|
2025-02-21 16:44:51 +07:00
|
|
|
<form>
|
|
|
|
|
{/* Input Email / No Telepon */}
|
|
|
|
|
<div className="mb-4">
|
|
|
|
|
<label
|
|
|
|
|
htmlFor="email"
|
|
|
|
|
className="mb-1 block text-gray-700"
|
|
|
|
|
>
|
|
|
|
|
Email/No. Telepon
|
|
|
|
|
</label>
|
|
|
|
|
<input
|
|
|
|
|
type="text"
|
|
|
|
|
placeholder="Contoh: legal@legalgo.id"
|
|
|
|
|
className="focus:inheriten w-full rounded-md border border-[#DFDFDF] p-2"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{/* Input Password */}
|
|
|
|
|
<div className="relative mb-4">
|
|
|
|
|
<label
|
|
|
|
|
htmlFor="password"
|
|
|
|
|
className="mb-1 block text-gray-700 focus:outline-[#2E2F7C]"
|
|
|
|
|
>
|
|
|
|
|
Kata Sandi
|
|
|
|
|
</label>
|
|
|
|
|
<input
|
|
|
|
|
type={showPassword ? 'text' : 'password'}
|
|
|
|
|
placeholder="Masukkan Kata Sandi"
|
|
|
|
|
className="w-full rounded-md border border-[#DFDFDF] p-2 pr-10 focus:outline-[#2E2F7C]"
|
|
|
|
|
/>
|
|
|
|
|
<button
|
|
|
|
|
type="button"
|
|
|
|
|
className="absolute top-9 right-3 text-gray-500"
|
|
|
|
|
onClick={() => setShowPassword(!showPassword)}
|
|
|
|
|
>
|
2025-02-22 15:15:04 +07:00
|
|
|
{showPassword ? (
|
|
|
|
|
<EyeIcon
|
|
|
|
|
width={15}
|
|
|
|
|
height={15}
|
|
|
|
|
/>
|
|
|
|
|
) : (
|
|
|
|
|
<EyeIcon
|
|
|
|
|
width={15}
|
|
|
|
|
height={15}
|
|
|
|
|
/>
|
|
|
|
|
)}
|
2025-02-21 16:44:51 +07:00
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{/* Lupa Kata Sandi */}
|
2025-02-22 21:17:56 +07:00
|
|
|
<div className="mb-4 flex items-center justify-between text-sm">
|
2025-02-21 16:44:51 +07:00
|
|
|
<span className="text-gray-600">Lupa Kata Sandi?</span>
|
2025-02-22 21:17:56 +07:00
|
|
|
<Button
|
|
|
|
|
onClick={() => {
|
|
|
|
|
setIsLoginOpen(false)
|
|
|
|
|
setIsForgetOpen(true)
|
|
|
|
|
}}
|
2025-02-21 16:44:51 +07:00
|
|
|
className="font-semibold text-[#2E2F7C]"
|
2025-02-22 21:17:56 +07:00
|
|
|
variant="link"
|
2025-02-21 16:44:51 +07:00
|
|
|
>
|
|
|
|
|
Reset Kata Sandi
|
2025-02-22 21:17:56 +07:00
|
|
|
</Button>
|
2025-02-21 16:44:51 +07:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{/* Tombol Masuk */}
|
2025-02-22 15:15:04 +07:00
|
|
|
<Button className="w-full rounded-md bg-[#2E2F7C] py-2 text-white transition hover:bg-blue-800">
|
2025-02-21 16:44:51 +07:00
|
|
|
Masuk
|
2025-02-22 15:15:04 +07:00
|
|
|
</Button>
|
2025-02-21 16:44:51 +07:00
|
|
|
</form>
|
|
|
|
|
|
|
|
|
|
{/* Link Daftar */}
|
|
|
|
|
<div className="mt-4 text-center text-sm">
|
|
|
|
|
Belum punya akun?{' '}
|
2025-02-22 17:14:33 +08:00
|
|
|
<Button
|
|
|
|
|
onClick={() => {
|
|
|
|
|
setIsLoginOpen(false)
|
|
|
|
|
setIsRegisterOpen(true)
|
|
|
|
|
}}
|
2025-02-21 16:44:51 +07:00
|
|
|
className="font-semibold text-[#2E2F7C]"
|
2025-02-22 17:14:33 +08:00
|
|
|
variant="link"
|
|
|
|
|
size="fit"
|
2025-02-21 16:44:51 +07:00
|
|
|
>
|
|
|
|
|
Daftar Disini
|
2025-02-22 17:14:33 +08:00
|
|
|
</Button>
|
2025-02-21 16:44:51 +07:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
}
|