List the action's rejected fields above the register form

This commit is contained in:
Aaron Po
2026-10-13 01:32:59 -04:00
parent e6240bc889
commit fffbe68dc2
2 changed files with 25 additions and 2 deletions

View File

@@ -1,10 +1,20 @@
interface AuthErrorAlertProps {
message: string;
/** Per-field messages to list beneath the summary. */
details?: readonly string[];
}
const AuthErrorAlert = ({ message }: AuthErrorAlertProps) => (
<div role="alert" className="alert alert-error alert-soft">
const AuthErrorAlert = ({ message, details }: AuthErrorAlertProps) => (
<div role="alert" className="alert alert-error alert-soft flex-col items-start">
<span>{message}</span>
{details?.length ? (
<ul className="list-inside list-disc text-sm">
{details.map((detail) => (
<li key={detail}>{detail}</li>
))}
</ul>
) : null}
</div>
);