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

Function createSidebarAddItem

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

Source from the content-addressed store, hash-verified

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).
199export 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.

Callers 3

CustomFeedSectionFunction · 0.90
NetworkSectionFunction · 0.90
BookmarkSectionFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected