ContactCard
Who to contact in HR, with WhatsApp and email.
$ npx shadcn@latest add https://mahrdesign.faizintifada.com/r/contact-card.jsonWhen to use
- "Kontak HR Anda" under the ProfileCard on Beranda (employee and manager).
- Anywhere the user may need help with data they cannot change (rekening, NIK, jabatan).
When not to use
- The manager ("Atasan Anda") → PersonCard variant="manager": the one manager block, with Email / Telepon rows.
- The signed-in person → ProfileCard.
- A teammate in a grid → PersonCard.
- A request that changes data → the "Minta perubahan ke HR" Sheet, not a WhatsApp chat.
- General help articles → the Bantuan page.
Do and don't
A real name, hours, and plain buttons"Ayu Wulandari · HR & GA · Senin–Jumat" with WhatsApp + Email as white buttons. Dimas knows who answers and when.
A blue "Hubungi" primary or a green WhatsApp buttonIt steals the screen's one primary. Brand colours are never used: colour means status or module.
Installation
Add ContactCard with the shadcn CLI (your project needs a components.json and the MaHR theme: https://mahrdesign.faizintifada.com/r/theme.json), or copy the files by hand.
API
import { ContactCard } from "@/components/mahr/contact-card"| Prop | Type | Default | Description |
|---|---|---|---|
person | { name, photoUrl?, role, hours? } | null | – | null → "Kontak HR belum diatur" line. |
whatsapp · email | string? | – | Max 2 buttons (WhatsApp, Email). Missing ones are left out. |
note | string? | – | One line in a neutral Callout. |
wide · loading | boolean · boolean | false · false | wide = buttons side by side. |
error · onRetry | boolean · () => void | false | Failed load: the title, then "Gagal dimuat." + secondary "Coba lagi" (shared LoadError pattern). No person set is not an error: it shows one calm line. |