import React from 'react';
import { Head, Link, router } from '@inertiajs/react';
import EmployerLayout from '@/Layouts/EmployerLayout';
import {
ArrowLeft,
Briefcase,
MapPin,
DollarSign,
Calendar,
Users,
FileText,
CheckCircle2,
XCircle,
Clock,
Edit2,
Trash2,
Eye
} from 'lucide-react';
import { Badge } from '@/components/ui/badge';
import { toast } from 'sonner';
export default function Show({ job }) {
const handleDelete = () => {
if (confirm('Are you sure you want to delete this job posting? This action cannot be undone.')) {
router.delete(`/employer/jobs/${job.id}`, {
onSuccess: () => {
toast.success('Job deleted successfully.');
},
onError: () => {
toast.error('Failed to delete job.');
}
});
}
};
const handleClose = () => {
if (confirm('Are you sure you want to close this job posting? No more workers will be able to apply.')) {
router.post(`/employer/jobs/${job.id}/close`, {}, {
onSuccess: () => {
toast.success('Job closed successfully.');
},
onError: () => {
toast.error('Failed to close job.');
}
});
}
};
return (
Location
{job.location}
Salary
{job.salary} AED / month
Workers Needed
{job.workers_needed} ({job.applied_count} applied)