From 03332246d34554ee9d6cef0baca27468ce9c2132 Mon Sep 17 00:00:00 2001 From: Bastien Chanot Date: Mon, 18 May 2026 21:17:12 +0200 Subject: [PATCH] feat(ui): Badge with tones --- src/components/ui/Badge.tsx | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/src/components/ui/Badge.tsx b/src/components/ui/Badge.tsx index e8373575..3fafb2bf 100644 --- a/src/components/ui/Badge.tsx +++ b/src/components/ui/Badge.tsx @@ -1,3 +1,25 @@ -export default function Badge() { - return
Badge placeholder
+import type { ReactNode } from 'react' + +export default function Badge({ + children, + tone = 'neutral', + className = '', +}: { + children: ReactNode + tone?: 'neutral' | 'accent' | 'warn' | 'danger' + className?: string +}) { + const map = { + neutral: 'bg-[var(--color-surface-strong)] text-[var(--color-ink)]', + accent: 'bg-[var(--color-accent)]/10 text-[var(--color-accent-strong)]', + warn: 'bg-amber-50 text-amber-700', + danger: 'bg-red-50 text-red-700', + } as const + return ( + + {children} + + ) }