(
title: string,
target: { onClick: () => void } | { href: string },
)
| 197 | // next squad / folder / feed. Pass either an `onClick` (button row, e.g. opens |
| 198 | // a modal) or an `href` (link row, e.g. a create page). |
| 199 | export const createSidebarAddItem = ( |
| 200 | title: string, |
| 201 | target: { onClick: () => void } | { href: string }, |
| 202 | ): SidebarMenuItem => ({ |
| 203 | icon: () => <ListIcon Icon={() => <PlusIcon />} />, |
| 204 | title, |
| 205 | ...('href' in target |
| 206 | ? { path: target.href, isForcedLink: true } |
| 207 | : { action: target.onClick }), |
| 208 | }); |
| 209 | |
| 210 | // A horizontal divider row that groups options inside a v2 panel, mirroring the |
| 211 | // settings dropdown. `key` just needs to be unique within the item list. |
no outgoing calls
no test coverage detected