quartz/quartz/cli/tui/components/Notification.tsx
2026-02-19 18:22:39 +01:00

25 lines
454 B
TypeScript

export interface NotificationMessage {
message: string
type: "success" | "error" | "info"
}
interface NotificationProps {
message: NotificationMessage
}
const COLOR_MAP = {
success: "green",
error: "red",
info: "cyan",
} as const
export function Notification({ message }: NotificationProps) {
return (
<box paddingX={1}>
<text>
<span fg={COLOR_MAP[message.type]}>{message.message}</span>
</text>
</box>
)
}