Skip to content

Commit 7e3d59a

Browse files
committed
fix(insights): remove left borders, copy as main button, analytics as secondary
1 parent e2fc0f5 commit 7e3d59a

1 file changed

Lines changed: 10 additions & 14 deletions

File tree

apps/dashboard/app/(main)/insights/_components/insight-card.tsx

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import { toast } from "sonner";
2525
import type {
2626
Insight,
2727
InsightSentiment,
28-
InsightSeverity,
2928
InsightType,
3029
} from "@/lib/insight-types";
3130
import {
@@ -114,12 +113,6 @@ const TYPE_STYLES: Record<
114113
},
115114
};
116115

117-
const SEVERITY_BORDER: Record<InsightSeverity, string> = {
118-
critical: "border-l-red-500",
119-
warning: "border-l-amber-500",
120-
info: "border-l-blue-400",
121-
};
122-
123116
const SENTIMENT_STYLES: Record<
124117
InsightSentiment,
125118
{ label: string; color: string }
@@ -203,8 +196,7 @@ export function InsightCard({
203196
return (
204197
<div
205198
className={cn(
206-
"group scroll-mt-24 border-b border-l-2 transition-colors",
207-
SEVERITY_BORDER[insight.severity],
199+
"group scroll-mt-24 border-b transition-colors",
208200
expanded ? "bg-accent/20" : "hover:bg-accent/40"
209201
)}
210202
id={`insight-${insight.id}`}
@@ -335,8 +327,16 @@ export function InsightCard({
335327
Investigate
336328
<ArrowRightIcon className="size-3" weight="fill" />
337329
</Link>
330+
<button
331+
className="inline-flex items-center gap-1.5 rounded border px-3 py-1.5 font-medium text-foreground text-xs transition-colors hover:bg-accent"
332+
onClick={copySummaryAction}
333+
type="button"
334+
>
335+
<CopyIcon aria-hidden className="size-3.5" weight="duotone" />
336+
Copy
337+
</button>
338338
<Link
339-
className="text-muted-foreground text-xs transition-colors hover:text-foreground"
339+
className="inline-flex items-center gap-1.5 rounded border px-3 py-1.5 text-muted-foreground text-xs transition-colors hover:bg-accent hover:text-foreground"
340340
href={insight.link}
341341
>
342342
View analytics
@@ -353,10 +353,6 @@ export function InsightCard({
353353
</button>
354354
</DropdownMenuTrigger>
355355
<DropdownMenuContent align="start" className="w-40">
356-
<DropdownMenuItem onClick={copySummaryAction}>
357-
<CopyIcon className="size-4" weight="duotone" />
358-
Copy insight
359-
</DropdownMenuItem>
360356
<DropdownMenuItem onClick={copyLinkAction}>
361357
<LinkIcon className="size-4" weight="duotone" />
362358
Copy link

0 commit comments

Comments
 (0)