import React, { useState } from 'react';
import { Head, useForm } from '@inertiajs/react';
import EmployerLayout from '../../Layouts/EmployerLayout';
import {
User,
CheckCircle2,
Save,
Building2,
Lock,
Bell,
ShieldCheck,
Mail,
Phone,
Globe,
CreditCard,
ChevronRight,
Camera,
Home,
Users,
MapPin,
History,
Sparkles
} from 'lucide-react';
import { toast } from 'sonner';
export default function Profile({ employerProfile }) {
const { data: profile, setData, post, processing, errors } = useForm({
name: employerProfile?.name || '',
company_name: employerProfile?.company_name || '',
email: employerProfile?.email || '',
phone: employerProfile?.phone || '',
language: employerProfile?.language || 'English',
nationality: employerProfile?.nationality || '',
family_size: employerProfile?.family_size || '',
accommodation: employerProfile?.accommodation || '',
district: employerProfile?.district || '',
notifications: employerProfile?.notifications ?? true,
emirates_id_front: null,
emirates_id_back: null,
current_password: '',
new_password: '',
new_password_confirmation: '',
});
const [activeTab, setActiveTab] = useState('personal');
const [saved, setSaved] = useState(false);
const handleSave = (e) => {
e.preventDefault();
post('/employer/profile/update', {
preserveScroll: true,
onSuccess: () => {
setSaved(true);
toast.success("🛡️ Profile updated successfully", {
description: "Household sponsor preferences and vetted credentials synchronized successfully."
});
setTimeout(() => setSaved(false), 3000);
},
onError: (errs) => {
toast.error("Failed to update profile", {
description: Object.values(errs)[0] || "Please check the form fields."
});
}
});
};
const tabs = [
{ id: 'personal', label: 'Personal', icon: User },
{ id: 'security', label: 'Security & Password', icon: Lock },
{ id: 'billing', label: 'Billing & Receipts', icon: CreditCard },
{ id: 'notifications', label: 'Notifications Hub', icon: Bell },
];
const pastHires = [
{ id: 1, name: 'Rhea Joy', category: 'Childcare / Nanny', nationality: 'Philippines', date: 'Jan 15, 2025', status: 'Active Contract' },
{ id: 2, name: 'Priya Sharma', category: 'Housekeeper', nationality: 'India', date: 'Jul 10, 2024', status: 'Completed / Expiry' }
];
return (
{profile.company_name}