Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

chore: files changed app/src/components/ui/Badge.tsx

Steven Enamakelac37b741a290
diff --git a/app/src/components/ui/Badge.tsx b/app/src/components/ui/Badge.tsx
index 7945695805..6243d20bf0 100644
--- a/app/src/components/ui/Badge.tsx
+++ b/app/src/components/ui/Badge.tsx
@@ -1,5 +1,5 @@
import { cva, type VariantProps } from 'class-variance-authority';
-import { type ReactNode } from 'react';
+import { type HTMLAttributes, type ReactNode } from 'react';
import { cn } from '../../lib/cn';
@@ -25,14 +25,30 @@ export const badgeVariants = cva(
export type BadgeVariant = NonNullable<VariantProps<typeof badgeVariants>['variant']>;
-export interface BadgeProps extends VariantProps<typeof badgeVariants> {
+export interface BadgeProps
+ extends Omit<HTMLAttributes<HTMLSpanElement>, 'children' | 'color'>,
+ VariantProps<typeof badgeVariants> {
children: ReactNode;
className?: string;
'data-testid'?: string;
}
-const Badge = ({ variant, children, className, 'data-testid': testId }: BadgeProps) => (
+/**
+ * Pill label. Any extra span attribute (`title`, `aria-*`, `onClick`, …) is
+ * forwarded to the rendered element, so a hand-rolled pill carrying a tooltip
+ * or an event handler can adopt this primitive without losing it. The
+ * component-owned attributes are applied after `...rest` so the default render
+ * is identical whether or not extra props are passed.
+ */
+const Badge = ({
+ variant,
+ children,
+ className,
+ 'data-testid': testId,
+ ...rest
+}: BadgeProps) => (
<span
+ {...rest}
data-slot="badge"
data-variant={variant ?? 'neutral'}
data-testid={testId}