/* eslint-disable @typescript-eslint/no-explicit-any */ import { Head, Link, usePage } from '@inertiajs/react'; import React from 'react'; import { Button } from '@/components/ui/button'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; import { Separator } from '@/components/ui/separator'; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip"; import AppLayout from '@/layouts/app-layout'; interface Position { id: number; name: string; employees_count: number; } interface PageProps { positions: Position[]; [key: string]: unknown; } interface SharedData { flash: { success?: string; error?: string; }; } export default function Index({ positions }: PageProps) { const { flash } = usePage().props as SharedData; return (
{flash?.success && (
{flash.success}
)} {flash?.error && (
{flash.error}
)}

Data Jabatan

Kelola level dan posisi pekerjaan.

Daftar Jabatan
{positions.length > 0 ? ( positions.map((pos) => ( )) ) : ( )}
Nama Jabatan Total Karyawan Aksi
{pos.name} 0 ? 'bg-blue-100 text-blue-800' : 'bg-gray-100 text-gray-600'}`}> {pos.employees_count} {pos.employees_count > 0 ? (

Tidak bisa dihapus: Digunakan oleh {pos.employees_count} karyawan.

) : ( { if (!confirm('Hapus jabatan ini?')) e.preventDefault(); }} className="inline-flex items-center justify-center rounded-md text-sm font-medium h-9 px-3 text-red-600 hover:bg-red-50" > Hapus )}
Belum ada data jabatan.
); }