import { MouseEventHandler, ReactNode } from "react"; export enum ButtonStyle { primary, success, danger, } export interface Props { onClick?: MouseEventHandler; style?: ButtonStyle; bold?: boolean; children?: ReactNode; } export default function Button(props: Props) { if (props.style === undefined) { return PrimaryButton(props); } switch (props.style) { case ButtonStyle.primary: return PrimaryButton(props); case ButtonStyle.success: return SuccessButton(props); case ButtonStyle.danger: return DangerButton(props); } } function PrimaryButton(props: Props) { return ( ); } function SuccessButton(props: Props) { return ( ); } function DangerButton(props: Props) { return ( ); }