PatientPanel: cake icon before the birth date, birthIcon slot

The icon can be replaced via the birthIcon prop (e.g. with an interactive one).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Ilya Mukhortov 2026-10-25 11:48:22 +10:00
parent ac8617d542
commit 7ac2af1b8b
1 changed files with 6 additions and 2 deletions

View File

@ -1,5 +1,5 @@
import * as React from "react"
import { CopyIcon, IdCardIcon, PhoneIcon, StethoscopeIcon } from "lucide-react"
import { CakeIcon, CopyIcon, IdCardIcon, PhoneIcon, StethoscopeIcon } from "lucide-react"
import { cn } from "../lib/utils"
import { copyToClipboard } from "../lib/clipboard"
@ -20,10 +20,12 @@ export interface PatientPanelPerson extends AvatarPerson {
/**
* Шапка пациента: аватар, ФИО, пол, дата рождения, контакты, действия справа
* и (необязательно) вкладки разделов карточки под ней. Лёгкая заливка — в цвет пола.
* birthIcon заменяет значок-торт перед датой рождения (например, интерактивным).
*/
export function PatientPanel<T extends string>({
person: p,
actions,
birthIcon,
tabs,
activeTab,
onTabChange,
@ -31,6 +33,7 @@ export function PatientPanel<T extends string>({
}: {
person: PatientPanelPerson
actions?: React.ReactNode
birthIcon?: React.ReactNode
tabs?: readonly ContentTabItem<T>[]
activeTab?: T
onTabChange?: (tab: T) => void
@ -68,7 +71,8 @@ export function PatientPanel<T extends string>({
</button>
</h1>
<GenderMark gender={p.gender} className="text-sm" />
<span className="text-sm text-muted-foreground tabular">
<span className="inline-flex items-center gap-1 self-center text-sm text-muted-foreground tabular">
{birthIcon ?? <CakeIcon className="size-3.5" />}
{p.birthDate} · <span className="text-foreground">{pluralYears(p.age)}</span>
</span>
</div>