import { clsx } from "clsx"

enum MessageVariant {
	Warning = "Warning",
	Error = "Error",
}

const VARIANT_CLASSES = {
	[MessageVariant.Warning]: "text-amber-600 dark:text-amber-200",
	[MessageVariant.Error]: "text-red-500 dark:text-red-300",
} as const

interface MessageProps {
	variant: MessageVariant
	className?: string
}

function Message({ variant, className, children }: React.PropsWithChildren<MessageProps>) {
	return <p className={clsx(VARIANT_CLASSES[variant], className)}>{children}</p>
}

export { Message, MessageVariant }
