go-guess/frontend/src/components/actions/ErrorAlert.tsx
Daniel Noulet 5d7a57fd00 refactor: split frontend application features
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-09-20 08:08:16 +02:00

19 lines
381 B
TypeScript

export function ErrorAlert({
message,
retry,
}: {
message: string
retry?: () => void | Promise<void>
}) {
return (
<div className="error-alert" role="alert">
<strong>Request failed</strong>
<span>{message}</span>
{retry && (
<button type="button" onClick={() => void retry()}>
Try again
</button>
)}
</div>
)
}