{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "page-header-04",
  "description": "A page title with its count beside it, and search and the main action on the same row.",
  "registryDependencies": [
    "button",
    "input-group",
    "https://www.dashboardblocks.com/r/radix/block-state.json",
    "https://www.dashboardblocks.com/r/radix/format.json",
    "https://www.dashboardblocks.com/r/radix/page-header.json"
  ],
  "files": [
    {
      "path": "registry/components/dashboardblocks/page-header/page-header-04.tsx",
      "content": "'use client'\n\nimport {\n  BlockStateProvider,\n  BlockStateText,\n  type BlockStateProps,\n  SkeletonText,\n  getBlockState,\n} from '@/registry/components/dashboardblocks/block-state'\nimport {\n  PageHeader,\n  PageHeaderActions,\n  PageHeaderHeading,\n  PageHeaderRow,\n} from '@/registry/components/dashboardblocks/page-header'\nimport { IconPlaceholder } from '@/registry/icons/icon-placeholder'\nimport { formatNumber } from '@/registry/lib/dashboardblocks/format'\nimport { useState } from 'react'\n\nimport { Button } from '@/components/ui/button'\nimport { InputGroup, InputGroupAddon, InputGroupInput } from '@/components/ui/input-group'\n\ninterface PageHeader4Props extends BlockStateProps {\n  /** Leave out to show the empty state. */\n  count?: number\n  description?: string\n  onCreate?: () => void\n  onSearch?: (query: string) => void\n  title: string\n}\n\nconst exampleProps: PageHeader4Props = {\n  count: 2_481,\n  description: '312 of them bought for the first time this month.',\n  title: 'Customers',\n}\n\nconst PageHeader4 = (props: PageHeader4Props) => {\n  const {\n    count,\n    description,\n    onCreate = () => {},\n    onSearch = () => {},\n    errorMessage,\n    status,\n    title,\n  } = props\n  const [query, setQuery] = useState('')\n  const state = getBlockState(status, count)\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={\n              state === 'loading' ? (\n                <SkeletonText className='w-56 max-w-full' />\n              ) : (\n                !state && description\n              )\n            }\n            badge={\n              <span className='text-muted-foreground text-2xl font-light tracking-tight tabular-nums'>\n                {state || count === undefined ? (\n                  <BlockStateText variant='short' />\n                ) : (\n                  formatNumber(count)\n                )}\n              </span>\n            }\n          />\n          <PageHeaderActions className='@2xl/page-header:flex-nowrap'>\n            <InputGroup className='min-w-0 flex-1 @2xl/page-header:w-64 @2xl/page-header:flex-none'>\n              <InputGroupAddon>\n                <IconPlaceholder\n                  lucide='SearchIcon'\n                  tabler='IconSearch'\n                  hugeicons='SearchIcon'\n                  phosphor='MagnifyingGlassIcon'\n                  remixicon='RiSearchLine'\n                />\n              </InputGroupAddon>\n              <InputGroupInput\n                type='search'\n                aria-label={`Search ${title.toLowerCase()}`}\n                placeholder={`Search ${title.toLowerCase()}`}\n                value={query}\n                disabled={state !== undefined}\n                onChange={(event) => {\n                  setQuery(event.target.value)\n                  onSearch(event.target.value)\n                }}\n              />\n            </InputGroup>\n            <Button onClick={onCreate}>\n              <IconPlaceholder\n                lucide='PlusIcon'\n                tabler='IconPlus'\n                hugeicons='PlusSignIcon'\n                phosphor='PlusIcon'\n                remixicon='RiAddLine'\n                data-icon='inline-start'\n              />\n              New customer\n            </Button>\n          </PageHeaderActions>\n        </PageHeaderRow>\n      </PageHeader>\n    </BlockStateProvider>\n  )\n}\n\nexport { PageHeader4, exampleProps as pageHeader4ExampleProps, type PageHeader4Props }\n",
      "type": "registry:component",
      "target": "@components/dashboardblocks/page-header/page-header-04.tsx"
    }
  ],
  "meta": {
    "shows": "A page title with its count beside it, and search and the main action on the same row.",
    "size": "full",
    "usedWith": [
      "data-table-02",
      "forms-02"
    ],
    "component": "PageHeader4",
    "props": "{ count?: number; description?: string; onCreate?: () => void; onSearch?: (query: string) => void; title: string; errorMessage?: string; status?: \"loading\" | \"error\" }"
  },
  "type": "registry:component"
}
