Hybrid row icons, row click, icon actions; DetailPanel header; ToggleGroup режима фильтра (settings-3). Co-authored-by: Cursor <[email protected]>
31 lines
950 B
TypeScript
31 lines
950 B
TypeScript
import { Shield } from 'lucide-react'
|
|
import { cn } from '@evofw/ui/lib/utils'
|
|
import { Item, ItemMedia } from '@evofw/ui/components/item'
|
|
|
|
type PolicySetIconProps = {
|
|
mode?: 'blacklist' | 'whitelist' | string | null
|
|
className?: string
|
|
}
|
|
|
|
/**
|
|
* KPI-style tile for policy set rows.
|
|
* Preview DNA: https://reui.io/preview/base/stats-12
|
|
*/
|
|
export function PolicySetIcon({ mode, className }: PolicySetIconProps) {
|
|
const isWhitelist = mode === 'whitelist'
|
|
return (
|
|
<Item
|
|
className={cn(
|
|
'border-background bg-muted flex size-10.5 shrink-0 items-center justify-center border-2 p-0 shadow-[0_1px_3px_0_rgba(0,0,0,0.14)] dark:border [&_svg]:size-4',
|
|
isWhitelist ? 'text-warning' : 'text-muted-foreground',
|
|
className,
|
|
)}
|
|
aria-label={isWhitelist ? 'Whitelist' : 'Blacklist'}
|
|
>
|
|
<ItemMedia variant="icon" className="size-auto">
|
|
<Shield aria-hidden />
|
|
</ItemMedia>
|
|
</Item>
|
|
)
|
|
}
|