import { Link } from 'react-router-dom' import { ArrowRight } from 'lucide-react' type ShortcutItem = { to: string title: string description: string badge?: string group?: string } type ManagementShortcutsProps = { title: string description?: string items: ShortcutItem[] } export function ManagementShortcuts({ title, description, items }: ManagementShortcutsProps) { const groups = groupShortcutItems(items) const hasNamedGroups = groups.some((group) => group.label) return (

{title}

{description &&

{description}

}
{hasNamedGroups ? (
{groups.map((group) => (
{group.label &&

{group.label}

}
))}
) : ( )}
) } function groupShortcutItems(items: ShortcutItem[]) { const groups: { label: string; items: ShortcutItem[] }[] = [] items.forEach((item) => { const label = item.group ?? '' const group = groups.find((candidate) => candidate.label === label) if (group) { group.items.push(item) return } groups.push({ label, items: [item] }) }) return groups } function ShortcutGrid({ items }: { items: ShortcutItem[] }) { return (
{items.map((item) => ( ))}
) } function ShortcutCard({ item }: { item: ShortcutItem }) { return (

{item.title}

{item.badge && ( {item.badge} )}

{item.description}

) }