mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-03-21 18:04:39 -05:00
31 lines
520 B
TypeScript
31 lines
520 B
TypeScript
import clsx from "clsx";
|
|
import type * as React from "react";
|
|
import styles from "./FormMessage.module.css";
|
|
|
|
export function FormMessage({
|
|
children,
|
|
type,
|
|
className,
|
|
spaced = true,
|
|
id,
|
|
}: {
|
|
children: React.ReactNode;
|
|
type: "error" | "info";
|
|
className?: string;
|
|
spaced?: boolean;
|
|
id?: string;
|
|
}) {
|
|
return (
|
|
<div
|
|
id={id}
|
|
className={clsx(
|
|
{ [styles.info]: type === "info", [styles.error]: type === "error" },
|
|
{ [styles.noMargin]: !spaced },
|
|
className,
|
|
)}
|
|
>
|
|
{children}
|
|
</div>
|
|
);
|
|
}
|