Karyawan · Detail
One employee: profile, tabs (Ringkasan, Cuti, Dokumen, Gaji, Akun login), the Ubah panels, archive and upload.
$ npx shadcn@latest add https://mahrdesign.faizintifada.com/r/screen-karyawan-detail.jsonWhen to use
- One employee for the admin / HR: who they are, their job, leave, documents, pay and login account, and the edits to them.
- The target of "Lihat detail" in the Karyawan list row menu (onRowAction(id, "detail")) and of "Lihat data" in the toast after Tambah karyawan.
- An archived person opens the same page, read-only, with "Pulihkan".
When not to use
- Many people at once → Karyawan · Daftar (the list), not prev / next through 48 records.
- The signed-in employee's own data → Profil saya (a later phase): the same cards with access "request" / "locked".
- A leave request or a payslip on its own → the Cuti and Gaji modules; here they are summaries with a link.
Built from
Usage
The screen is the page content only. Put it inside AppShell (once, in your layout) and pass your data.
Installation
Adds the screen, its parts and its types. The components it uses come with it (registry dependencies).
API
import { KaryawanDetail } from "@/components/screens/karyawan-detail/karyawan-detail"| Prop | Type | Default | Description |
|---|---|---|---|
status | "ready" | "loading" | "error" | – | loading keeps every box at its ready height (header row 44, profile card 174, tabs 44, Ringkasan cards). error = the header row + LoadError illustrated. |
data | KaryawanDetailData | – | { employee, position, today, payRun, departments, locations, managers, banks }. employee holds job, personal data, leave, documents, pay (components first = Gaji pokok), account and archived. See types.ts. |
error · onRetry | { code; at } · () => void | – | Support line under "Coba lagi": "Kode: EMP-500 · 16 Des 2026, 09.41". |
listHref · listRender | string · ReactElement | "/karyawan" · – | "‹ Semua karyawan" (BackButton, a real link). Keep the list query in it. |
onNavigate | (direction: "prev" | "next") => void | – | Prev / next in the list order; disabled at the ends (data.position). |
onTabChange | (tab: TabId) => void | – | Ringkasan · Cuti · Dokumen · Gaji · Akun login. A tab change hides the salary again. |
onSaveJob · onSavePersonal · onSavePay | (form) => void | Promise | – | The Ubah Sheets. Return a promise: "Menyimpan…" until it settles, then the panel closes and a toast says what was saved (no action). Pass the new record in data. |
onArchive · onRestore | (form: ArchiveForm) => void | Promise · () => void | – | Arsipkan (menu) opens a Sheet: Alasan keluar, Alasan lain (Lainnya), Tanggal keluar. After it, pass the archived record: the page is read-only with "Pulihkan". |
onUpload | (form: UploadForm, onProgress) => Promise | – | PDF, JPG or PNG up to 5 MB (checked when chosen). Call onProgress(0–100). Then the panel closes, the new row is first with a short tint, toast "Dokumen diunggah". |
onDocumentAction · onAccountAction | (id, "unduh" | "hapus") · ("atur-ulang-sandi" | "kirim-undangan" | "nonaktifkan") | – | Callbacks only: the app confirms "hapus" and "nonaktifkan" with a destructive Dialog on the page (never on a Sheet). |
onDownloadPdf · onEditLeaveBalance · onRecordLeave · onOpenSlip · onDownloadSlip | callbacks | – | Menu "Unduh data karyawan (PDF)"; "Ubah saldo" and "Catat cuti" (Cuti module panels); "Lihat slip gaji" (slip id, or null for all); "Unduh" in the slip list. |
defaultUi | { tab?, revealed?, menuOpen?, panel?, toast?, newDocumentId? } | – | Start UI state for previews and tests only. |