{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "page-header-02",
  "description": "A page title with its status as a coloured word and links to the page's sections, each with a count.",
  "registryDependencies": [
    "button",
    "https://www.dashboardblocks.com/r/radix/block-state.json",
    "https://www.dashboardblocks.com/r/radix/page-header.json",
    "https://www.dashboardblocks.com/r/radix/status-label.json"
  ],
  "files": [
    {
      "path": "registry/components/dashboardblocks/page-header/page-header-02.tsx",
      "content": "'use client'\n\nimport {\n  BlockStateProvider,\n  BlockStateText,\n  type BlockState,\n  type BlockStateProps,\n  SkeletonText,\n  getBlockState,\n} from '@/registry/components/dashboardblocks/block-state'\nimport {\n  PageHeader,\n  PageHeaderActions,\n  PageHeaderHeading,\n  PageHeaderRow,\n  type PageTab,\n  PageTabs,\n} from '@/registry/components/dashboardblocks/page-header'\nimport {\n  StatusLabel,\n  type StatusTone,\n} from '@/registry/components/dashboardblocks/status-label'\nimport { IconPlaceholder } from '@/registry/icons/icon-placeholder'\n\nimport { Button } from '@/components/ui/button'\n\ntype ProjectStatus = 'draft' | 'live' | 'paused'\n\nconst STATUS: Record<ProjectStatus, { label: string; tone: StatusTone }> = {\n  draft: { label: 'Draft', tone: 'neutral' },\n  live: { label: 'Live', tone: 'good' },\n  paused: { label: 'Paused', tone: 'warning' },\n}\n\ninterface PageHeader2Props extends BlockStateProps {\n  /** Leave out to show the empty state. */\n  description?: string\n  onInvite?: () => void\n  pathname: string\n  projectStatus?: ProjectStatus\n  tabs: PageTab[]\n  title: string\n}\n\nconst exampleProps: PageHeader2Props = {\n  description:\n    'Storefront, checkout and fulfilment for the EU region, with 12 orders to ship and 3 open issues.',\n  pathname: '/projects/acme-store',\n  projectStatus: 'live',\n  tabs: [\n    { href: '/projects/acme-store', title: 'Overview' },\n    { badge: 12, href: '/projects/acme-store/orders', title: 'Orders' },\n    { href: '/projects/acme-store/customers', title: 'Customers' },\n    { badge: 3, href: '/projects/acme-store/issues', title: 'Issues' },\n    { href: '/projects/acme-store/settings', title: 'Settings' },\n  ],\n  title: 'Acme Store',\n}\n\nfunction tabBadge(tab: PageTab, state: BlockState) {\n  if (tab.badge === undefined || state !== 'loading') return undefined\n  return <SkeletonText className='w-4' />\n}\n\nconst PageHeader2 = (props: PageHeader2Props) => {\n  const {\n    description,\n    onInvite = () => {},\n    pathname,\n    projectStatus,\n    errorMessage,\n    status,\n    tabs,\n    title,\n  } = props\n  const state = getBlockState(status, description)\n\n  return (\n    <BlockStateProvider errorMessage={errorMessage} state={state}>\n      <PageHeader>\n        <PageHeaderRow className='@2xl/page-header:items-end'>\n          <PageHeaderHeading\n            title={title}\n            description={state ? <BlockStateText /> : description}\n            badge={\n              state === 'loading' ? (\n                <SkeletonText className='w-10' />\n              ) : (\n                !state &&\n                projectStatus && (\n                  <StatusLabel tone={STATUS[projectStatus].tone}>\n                    {STATUS[projectStatus].label}\n                  </StatusLabel>\n                )\n              )\n            }\n          />\n          <PageHeaderActions>\n            <Button variant='outline' onClick={onInvite}>\n              <IconPlaceholder\n                lucide='UserPlusIcon'\n                tabler='IconUserPlus'\n                hugeicons='UserAdd01Icon'\n                phosphor='UserPlusIcon'\n                remixicon='RiUserAddLine'\n                data-icon='inline-start'\n              />\n              Invite\n            </Button>\n          </PageHeaderActions>\n        </PageHeaderRow>\n        <PageTabs\n          items={\n            state ? tabs.map((tab) => ({ ...tab, badge: tabBadge(tab, state) })) : tabs\n          }\n          pathname={pathname}\n        />\n      </PageHeader>\n    </BlockStateProvider>\n  )\n}\n\nexport { PageHeader2, exampleProps as pageHeader2ExampleProps, type PageHeader2Props }\n",
      "type": "registry:component",
      "target": "@components/dashboardblocks/page-header/page-header-02.tsx"
    }
  ],
  "meta": {
    "shows": "A page title with its status as a coloured word and links to the page's sections, each with a count.",
    "size": "full",
    "usedWith": [
      "data-table-02",
      "record-detail-01"
    ],
    "component": "PageHeader2",
    "props": "{ description?: string; onInvite?: () => void; pathname: string; projectStatus?: \"draft\" | \"paused\" | \"live\"; tabs: { badge?: ReactNode; href: string; icon?: ReactNode; id?: string; indicator?: ReactNode; title: string }[]; title: string; errorMessage?: string; status?: \"loading\" | \"error\" }"
  },
  "type": "registry:component"
}
