mirror of
https://github.com/supabase/supabase.git
synced 2026-10-18 07:39:07 +03:00
* Init AiAssistantPanel * Temp * Temp * iterating on assistant ux * More spiking * Tweaking... * Moar tweaking.. * Even more tweaking * Tweek * More tweaks * Final tweaking... * TWEAK * Spelling * Fix * Assistant error handling and small bug fix in context for message * Add feature flag * Fix * Address all feedback * Minor
34 lines
1.1 KiB
TypeScript
34 lines
1.1 KiB
TypeScript
import { X } from 'lucide-react'
|
|
import { ReactNode } from 'react'
|
|
import { Tooltip_Shadcn_, TooltipContent_Shadcn_, TooltipTrigger_Shadcn_ } from 'ui'
|
|
|
|
interface ContextBadgeProps {
|
|
label: string
|
|
value: string
|
|
tooltip?: ReactNode
|
|
onRemove?: () => void
|
|
}
|
|
|
|
export const ContextBadge = ({ label, value, tooltip, onRemove }: ContextBadgeProps) => {
|
|
return (
|
|
<Tooltip_Shadcn_>
|
|
<TooltipTrigger_Shadcn_ asChild>
|
|
<div className="border bg-surface-200 rounded px-2 py-1 flex items-center justify-between gap-x-2">
|
|
<div className="flex items-center gap-x-1">
|
|
<span className="text-foreground-lighter text-xs">{label}</span>
|
|
<span className="text-xs">{value}</span>
|
|
</div>
|
|
{onRemove !== undefined && (
|
|
<X
|
|
size={12}
|
|
className="text-foreground-light hover:text-foreground transition cursor-pointer"
|
|
onClick={() => onRemove()}
|
|
/>
|
|
)}
|
|
</div>
|
|
</TooltipTrigger_Shadcn_>
|
|
{tooltip !== undefined && <TooltipContent_Shadcn_>{tooltip}</TooltipContent_Shadcn_>}
|
|
</Tooltip_Shadcn_>
|
|
)
|
|
}
|