Skip to content

Commit 33f57fd

Browse files
style: restyle ErrorBanner with neutral card fill and destructive accent bar
Replace the all-red destructive Alert variant (transparent background, full red text) with a neutral card-filled banner, a left destructive accent bar, red icon, foreground title, and muted body/detail text. Improves the send-error and git-error banners on the dark theme.
1 parent 3f3670d commit 33f57fd

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

frontend/src/components/ui/error-banner.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Alert, AlertTitle, AlertDescription } from '@/components/ui/alert'
22
import { Button } from '@/components/ui/button'
33
import { AlertCircle, X } from 'lucide-react'
4+
import { cn } from '@/lib/utils'
45

56
export interface ErrorBannerProps {
67
title?: string
@@ -12,29 +13,29 @@ export interface ErrorBannerProps {
1213

1314
export function ErrorBanner({ title, summary, detail, onDismiss, className }: ErrorBannerProps) {
1415
return (
15-
<Alert variant="destructive" className={className}>
16+
<Alert className={cn('bg-card border-border border-l-[3px] border-l-destructive', className)}>
1617
<div className="flex flex-col gap-2">
1718
<div className="flex items-start gap-2">
18-
<AlertCircle className="h-4 w-4 mt-0.5 flex-shrink-0" />
19+
<AlertCircle className="h-4 w-4 mt-0.5 flex-shrink-0 text-red-400" />
1920
<div className="flex-1 min-w-0">
2021
{title && (
21-
<AlertTitle className="mb-1 font-medium leading-none tracking-tight">{title}</AlertTitle>
22+
<AlertTitle className="mb-1 font-medium leading-none tracking-tight text-foreground">{title}</AlertTitle>
2223
)}
23-
<AlertDescription className="text-sm">{summary}</AlertDescription>
24+
<AlertDescription className="text-sm text-muted-foreground">{summary}</AlertDescription>
2425
</div>
2526
{onDismiss && (
2627
<Button
2728
variant="ghost"
2829
size="sm"
29-
className="h-7 w-7 p-0 flex-shrink-0"
30+
className="h-7 w-7 p-0 flex-shrink-0 text-muted-foreground"
3031
onClick={onDismiss}
3132
>
3233
<X className="w-3.5 h-3.5" />
3334
</Button>
3435
)}
3536
</div>
3637
{detail && (
37-
<pre className="p-2 rounded border bg-destructive/5 border-destructive/20 text-xs font-mono overflow-auto max-h-32">
38+
<pre className="p-2 rounded border bg-background border-border text-xs font-mono text-muted-foreground overflow-auto max-h-32">
3839
{detail}
3940
</pre>
4041
)}

0 commit comments

Comments
 (0)