mirror of
https://github.com/supabase/supabase.git
synced 2026-12-04 15:39:13 +00:00
## Context This is largely just a mechanical change here: Opting to use lucide icons with the `Icon` suffix across all icon imports within `studio` - so that it’s clearer which components are icons + reduces the possibility of name collision with our own components - e.g <User /> vs <UserIcon /> Also added a eslint rule for this: <img width="1069" height="167" alt="image" src="https://github.com/user-attachments/assets/7f36f443-5ca2-4bf6-8d22-86e774513bfc" /> And updated `AGENTS.md` as such: ``` Icons come from `lucide-react`, always imported with the `Icon` suffix (`import { CheckIcon, Trash2Icon } from 'lucide-react'`) — never the bare names (`Check`) or `Check as CheckIcon` aliases (lint-enforced). ```
29 lines
1.2 KiB
TypeScript
29 lines
1.2 KiB
TypeScript
import { ChevronRightIcon } from 'lucide-react'
|
|
import type { PropsWithChildren, ReactNode } from 'react'
|
|
import { cn, Collapsible, CollapsibleContent, CollapsibleTrigger } from 'ui'
|
|
|
|
type ToolGroupProps = PropsWithChildren<{
|
|
label: ReactNode
|
|
/** Shimmers the label to show work is in progress. */
|
|
isActive?: boolean
|
|
}>
|
|
|
|
/** Folds a run of `Tool` rows behind a single summary row. */
|
|
export function ToolGroup({ label, isActive = false, children }: ToolGroupProps) {
|
|
return (
|
|
<Collapsible className="w-full max-w-3xl mx-auto my-4 first:mt-0 last:mb-0 text-foreground-lighter">
|
|
<CollapsibleTrigger className="group/tool-group flex items-center gap-2 w-full py-2 text-left">
|
|
<ChevronRightIcon
|
|
strokeWidth={1.5}
|
|
size={12}
|
|
className="shrink-0 transition-transform duration-200 ease-out group-data-[state=open]/tool-group:rotate-90"
|
|
/>
|
|
<span className={cn('min-w-0 truncate', isActive && 'shimmer')}>{label}</span>
|
|
</CollapsibleTrigger>
|
|
<CollapsibleContent className="overflow-hidden data-open:animate-collapsible-down data-closed:animate-collapsible-up">
|
|
<div className="ml-1.5 pl-4 border-l border-muted">{children}</div>
|
|
</CollapsibleContent>
|
|
</Collapsible>
|
|
)
|
|
}
|