30 lines
547 B
TypeScript
30 lines
547 B
TypeScript
|
|
"use client";
|
||
|
|
|
||
|
|
export function StatusBanner({
|
||
|
|
status,
|
||
|
|
error,
|
||
|
|
}: {
|
||
|
|
status: string | null;
|
||
|
|
error: string | null;
|
||
|
|
}) {
|
||
|
|
if (!status && !error) return null;
|
||
|
|
if (error) {
|
||
|
|
return (
|
||
|
|
<div
|
||
|
|
role="alert"
|
||
|
|
className="rounded-xl border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700"
|
||
|
|
>
|
||
|
|
{error}
|
||
|
|
</div>
|
||
|
|
);
|
||
|
|
}
|
||
|
|
return (
|
||
|
|
<div
|
||
|
|
role="status"
|
||
|
|
className="rounded-xl border border-emerald-200 bg-emerald-50 px-4 py-3 text-sm text-emerald-700"
|
||
|
|
>
|
||
|
|
{status}
|
||
|
|
</div>
|
||
|
|
);
|
||
|
|
}
|