Karyawan · Daftar
The employee list: tabs, search, who cannot be paid yet, and the Tambah karyawan panel.
$ npx shadcn@latest add https://mahrdesign.faizintifada.com/r/screen-karyawan-daftar.jsonWhen to use
- The admin / HR list of all employees: find someone, see who cannot be paid yet, open a person, add one.
- Tabs split the people by status (Semua · Percobaan · Kontrak · Diarsipkan); counts stay the same while searching.
- A new company sees the first-run card instead: Impor dari Excel (10+ people) or Tambah satu per satu.
When not to use
- One employee's full data → Karyawan · Detail (/screens/karyawan-detail/), not a bigger row. "Lihat detail" in the row menu and "Lihat data" in the toast go there.
- Many people at once → Karyawan · Impor dari Excel (onImport), not the Tambah panel ten times.
- Employees and managers looking for a teammate → Organisasi (people grid), not this admin list.
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 { KaryawanDaftar } from "@/components/screens/karyawan-daftar/karyawan-daftar"| Prop | Type | Default | Description |
|---|---|---|---|
status | "ready" | "loading" | "error" | "empty" | – | loading keeps every box at its ready height (header 44, toolbar 44, notice 82, rows 64, pager 44). empty = first run (no list). |
data | KaryawanData | – | ONE page from your server, already filtered, sorted and paged: rows (or archived on the Diarsipkan tab) + page, counts per tab, notPayableCount, departments, payMonth, today (ISO, the default Tanggal bergabung in Tambah), nextEmployeeNo, managers, banks. The screen never filters or sorts rows itself. See types.ts. |
error | { code: string; at: string } | – | Support line under "Coba lagi": "Kode: EMP-500 · 16 Des 2026, 09.41". |
onRetry | () => void | – | "Coba lagi" in the error card. |
onQueryChange | (query: KaryawanQuery) => void | – | Every change in one object: { tab, search, department, notPayableOnly, sort, page }. Load that page and pass it back in data. A change of anything but the page starts again at page 1. A new tab ends the "belum bisa digaji" filter. Sort: one column at a time (none → A–Z → Z–A), default Karyawan A–Z. |
onRowAction | (rowId, "detail" | "ubah" | "lengkapi" | "arsipkan") => void | – | Row menu. "Lengkapi …" shows only when pay data is missing; in the "belum bisa digaji" filter it is a button in the row. |
onImport · onDownloadTemplate | () => void | – | "Impor dari Excel" (header and first run) and the template link. |
onAdd | (form: TambahForm, then: "close" | "again") => void | Promise | – | Save from the Tambah panel. "Simpan & tambah lagi" keeps the panel open with a clean form. Then a toast with "Lihat data" (8 s). |
onOpenEmployee | (employeeNo) => void | – | "Lihat data" in the toast. |
defaultUi | { query?, menuRowId?, panel?, toast? } | – | Start UI state for previews and tests only (query = the start query; give your data layer the same one). |