Ringkasan

The admin home: what needs you today, payroll readiness, setup and who is out.

$ npx shadcn@latest add https://mahrdesign.faizintifada.com/r/screen-ringkasan.json
Buka layar penuh

When to use

  • The first screen after an admin or HR signs in: what needs them today, whether payroll is ready, who is out.
  • One per company. The payroll card follows the payroll month: readiness → all ready → pay day → after pay day.

When not to use

  • Employees and managers → their own Beranda (a later phase), not this screen.
  • A full list of leave requests → Cuti · Permintaan; "Lihat semua" links there.
  • Payroll work itself → the Gaji screens; this card only shows readiness and the next step.

Built from

Usage

The screen is the page content only. Put it inside AppShell (once, in your layout) and pass your data.

page.tsx
import { AppShell } from "@/components/mahr/app-shell"import { Ringkasan } from "@/components/screens/ringkasan/ringkasan"export default function Page() {  const { data, isLoading, error, refetch } = useDashboard() // your data layer  return (    <AppShell role="admin" activeItem="ringkasan" company={company} user={me} leaveCount={data?.approvals.length}>      <Ringkasan        status={error ? "error" : isLoading ? "loading" : data?.isNewCompany ? "empty" : "ready"}        data={data}        error={error && { code: error.code, at: error.at }}        onRetry={refetch}        onApprove={(id) => approveLeave(id)}        onUndoApprove={(id) => undoApproveLeave(id)}        onReject={(id, reason) => rejectLeave(id, reason)} // after the built-in "Tolak cuti … ?" dialog        linkRender={<Link href="" />}      />    </AppShell>  )}

Installation

Adds the screen, its parts and its types. The components it uses come with it (registry dependencies).

terminal
bunx --bun shadcn@latest add https://mahrdesign.faizintifada.com/r/screen-ringkasan.json

API

import { Ringkasan } from "@/components/screens/ringkasan/ringkasan"
PropTypeDefaultDescription
status"ready" | "loading" | "error" | "empty"–empty = new company: "Mulai di sini" + an empty "Hari ini". loading keeps the quick actions real.
dataRingkasanData–quickActions, kpis, approvals, payroll (4 forms), schedule, setup | null, contracts, today. See types.ts.
error{ code: string; at: string }–Shown under "Coba lagi" for support ("Kode: DASH-500 · 16 Des 2026, 09.41").
onRetry() => void–"Coba lagi" in the error card.
onApprove · onUndoApprove(id: string) => void–Setujui acts at once; the row then says "Cuti … disetujui" with "Urungkan" (undo). Remove the request from data once it can no longer be undone.
onReject(id: string, reason?: string) => void–Called from the built-in dialog "Tolak cuti … ?" (optional reason). Tolak never acts without that confirmation.
defaultUi{ approved?: string[]; rejecting?: string }–Start UI state for previews and tests only.
onQuickAction · onSetupStep(id: string) => void–Quick-action chips and the active setup step button.
onTodayMove(delta: -1 | 1) => void–Day arrows in "Hari ini"; pass the new day's data back in data.today.
linkRenderReactElement–Router link for every "Lihat …" link, e.g. <Link href="" />.