Undangan · Buat password
The invite link: set your own password (or the link has expired). No shell.
$ npx shadcn@latest add https://mahrdesign.faizintifada.com/r/screen-undangan.jsonWhen to use
- The page an invite link opens (/undangan/<token>): the person sets their own password and is signed in. HR never sees a password.
- The invite goes by email, or by WhatsApp to the phone number when the person has no email.
- UndanganKedaluwarsa: the same link after 7 days or after it was used once.
When not to use
- Signing in with an existing password → Login.
- Changing a password while signed in → the account menu ("Ubah password").
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
Undangan
import { Undangan } from "@/components/screens/undangan/undangan"| Prop | Type | Default | Description |
|---|---|---|---|
person | { firstName; channel: "whatsapp" | "email"; identifier } | – | The read-only sign-in field: "Nomor HP" + smartphone icon, or "Email" + mail icon, with its helper line. |
company · role | string · "employee" | "admin" | "employee" | The subtitle: employee "… untuk melihat slip gaji dan mengajukan cuti."; admin "… untuk mengelola karyawan, cuti, dan gaji." |
expiresOn · today | ISO date · ISO date | – | "Link ini berlaku sampai Kamis, 24 Des 2026." · "… sampai hari ini." on the last day. |
status · error · attempt | "idle" | "submitting" · { kind: "network" | "server" } | null · number | – | "Menyimpan…"; a failed save shows "Gagal menyimpan password. Coba lagi." above the primary. |
onSubmit | ({ password }) => void | – | Only when 8+ characters and both fields are the same; else field errors, shake, focus, red rules. |
autoFocus · minHeight · logo | boolean · number | string · ReactNode | – | As Login. |
UndanganKedaluwarsa
import { UndanganKedaluwarsa } from "@/components/screens/undangan/undangan"| Prop | Type | Default | Description |
|---|---|---|---|
loginHref · loginRender | string · ReactElement | – | "Sudah punya password? Masuk": one secondary pill that is a real link (docs/buttons.md, dead-end page). |