TodayCard
Today's opening in the owner's chat, for whoever reads it: what needs them, the days in numbers, their own bookings listed — when, who, what — and the rest of the team told in a line each, with a way into today at its foot.
Playground
Daily overview · Fri, Oct 9
Inbox
2 conversations need you2 conversations need you
Bookings
- Yesterday
- ~€420
- 8 bookings
- Today
- ~€310
- 6 bookings
Okami booked 5 new appointments yesterday.
Your clients today
- 09:00Marek NovákHaircut
- 10:00Peter HorváthHaircut + beard
- 13:00Lukáš BalážHaircut
The team
- Kelso5 bookings, the first at 09:30
- MilaNo bookings yet
import { TodayCard } from "@/components/shared/today-card";
<TodayCard
recap={recapOf(await dayPicture(ctx, today), member.staffId)}
date={today}
locale={locale}
today={today}
href={`/${locale}`}
onOpen={() => open(`/${locale}`)}
needsYou={useInboxUnread()}
inboxHref={`/${locale}/inbox?filter=needs`}
numbers={await dayNumbers(ctx, today)}
/>API
| Prop | Type | Default | Description |
|---|---|---|---|
| recap | DayRecap | — | recapOf(dayPicture, staffId): the member's own bookings (null for someone who takes no clients), and everyone else in or booked that day with their count and first booking. |
| date | string | — | The day, YYYY-MM-DD: the heading names it (Daily overview · Fri, Oct 9), so no date line sits over the card. |
| locale | string | — | How the date reads in the heading. |
| href | string | — | Today in the app. Leave it out to show no link. |
| onOpen | () => void | — | Opens it in place instead of following the link: the app pane on a phone. |
| needsYou | number | 0 | The conversations that need a person (the Inbox's count). Above zero, an Inbox section opens the card, the count in red. |
| inboxHref | string | — | The Inbox on its Needs you tab (/inbox?filter=needs): Open Inbox, at the Inbox section's foot. Leave it out to show no link. |
| onOpenInbox | () => void | — | Opens the Inbox in place instead of following the link. |
| numbers | DayNumbers | null | — | dayNumbers(ctx, today): yesterday's and today's bookings with what they were booked at, and what Okami booked yesterday. The owner's are the studio's; staff's, their own chair's. Left out while both days are empty. |
| labels | Partial<TodayCardLabels> | English | The heading (given the date), the two section names, the empty line, each teammate's line (count and first), Open today, the Needs you line and Open Inbox, and the numbers' words. |
Guidelines
- Built from the day as it stands, not the count kept when the day opened: only today's opening shows it; earlier days keep their line.
- What needs a person comes first, with the way to it; nothing needing anyone says nothing.
- Amounts are what the bookings were made at, so they read as an estimate (~€420): Okami sees no payments or no-shows. A day with nothing booked reads €0.
- Yours in full, others in a line: the reader acts on their own day and only needs to know of the rest. For the whole day, the DayCard.
- Its sections and lines are the DayCard's rows (DaySection, BookingRow, DayRow; see DayCard › Rows), so the same day reads the same in both cards.