MCPcopy Create free account
hub / github.com/dailydotdev/apps / createSidebarAddItem

Function createSidebarAddItem

packages/shared/src/components/sidebar/common.tsx:201–210  ·  view source on GitHub ↗
(
  title: string,
  target: { onClick: () => void } | { href: string },
)

Source from the content-addressed store, hash-verified

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

Callers 2

NetworkSectionFunction · 0.90
BookmarkSectionFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected