form feedback consolidation

This commit is contained in:
2026-01-06 14:00:22 -05:00
parent a11f1fee50
commit 374c924119
3 changed files with 82 additions and 70 deletions

View File

@@ -0,0 +1,27 @@
import { Show, type JSX } from "solid-js";
export interface FormFeedbackProps {
type: "success" | "error";
message: string | JSX.Element;
show?: boolean;
class?: string;
}
export default function FormFeedback(props: FormFeedbackProps) {
const show = () => props.show ?? true;
return (
<Show when={show()}>
<div
class={`text-center text-sm ${
props.type === "success" ? "text-green" : "text-red"
} ${props.class || ""}`}
role="alert"
>
{props.message}
</div>
</Show>
);
}
export { FormFeedback };