import { ReactNode } from "react"; import { ButtonStyle } from "./Button"; export type NoticeStyle = ButtonStyle; export interface Props { header?: string; style?: NoticeStyle; children?: ReactNode; } export default function Notice(props: Props) { if (props.style === undefined) { return PrimaryNotice(props); } switch (props.style) { case ButtonStyle.primary: return PrimaryNotice(props); case ButtonStyle.success: return SuccessNotice(props); case ButtonStyle.danger: return DangerNotice(props); } } function PrimaryNotice(props: Props) { return (
{props.children}
); } function SuccessNotice(props: Props) { return (
{props.children}
); } function DangerNotice(props: Props) { return (
{props.header && (

{props.header}

)}
{props.children}
); }