'use client'; import { useState } from 'react'; import { XMarkIcon, KeyIcon } from '@heroicons/react/24/outline'; import { createUserForEmployee } from '@/app/employees/actions'; interface UserCreationModalProps { isOpen: boolean; onClose: () => void; employeesWithoutUser: any[]; } export default function UserCreationModal({ isOpen, onClose, employeesWithoutUser }: UserCreationModalProps) { const [error, setError] = useState(null); const [loading, setLoading] = useState(false); if (!isOpen) return null; async function handleSubmit(formData: FormData) { setLoading(true); setError(null); try { const result = await createUserForEmployee(formData); if (result.error) { setError(result.error); } else { onClose(); } } catch (err) { setError('Bir hata oluştu, lütfen tekrar deneyin.'); } finally { setLoading(false); } } return (
{/* Header */}

Kullanıcı Tanımla

Personel için sistem girişi oluşturun.

{/* Body */}
{error && (
{error}
)}
); }