posture.tsx
This file
Path
apps/web/src/features/shared/posture.tsx
37 lines · 943 bytes · TypeScript
Last changed by
Merge build/comments-web-features into mainoscabrielbefore adoption74bfc72
History of this fileTake it
1234567891011121314151617181920212223242526272829303132333435363738/** * The posture literal rides as `data-posture`, so tests and styles key on it; * the words are the platform's label, never rewritten here. */import type { Posture } from "@repo/protocol/posture";
import { POSTURE_MARKS } from "./mark-look.ts";import { StateBadge } from "./state-badge.tsx";
const wordTone = { open: "text-foreground", openCore: "text-sealed", openOnSchedule: "text-sealed", openWithSealedEvidence: "text-sealed", sourceAvailable: "text-muted-foreground",} as const satisfies Record<Posture, string>;
export const PostureBadge = ({ label, posture, title,}: { readonly label: string; readonly posture: Posture; readonly title?: string | undefined;}) => ( <StateBadge className="text-ui items-start [&>svg]:mt-0.5" mark={POSTURE_MARKS[posture]} word={ <span data-posture={posture} title={title}> {label} </span> } wordTone={wordTone[posture]} />);