{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "openlmis-service-accounts-page",
  "title": "Service Accounts Page",
  "description": "Mock service-key list with sorting, paging, add/delete dialogs and copy-state presentation.",
  "dependencies": [
    "@tanstack/react-table@^9",
    "lucide-react@^1",
    "@base-ui/react@^1"
  ],
  "registryDependencies": [
    "alert",
    "alert-dialog",
    "button",
    "dropdown-menu",
    "spinner",
    "https://registry.soldevelo.com/r/openlmis-callout.json",
    "https://registry.soldevelo.com/r/openlmis-copyable-value.json",
    "https://registry.soldevelo.com/r/openlmis-data-table.json",
    "https://registry.soldevelo.com/r/openlmis-form-dialog.json",
    "https://registry.soldevelo.com/r/openlmis-list-toolbar.json",
    "https://registry.soldevelo.com/r/openlmis-workspace.json"
  ],
  "files": [
    {
      "path": "registry/templates/openlmis/service-accounts-page/components/mock-service-accounts.ts",
      "content": "import type { ServiceAccount } from \"@/components/openlmis/service-accounts-page/service-account\"\n\nexport const MOCK_SERVICE_ACCOUNTS: ServiceAccount[] = [\n  {\n    token: \"6f1c8e2a-41b7-4f3d-9a0e-5c2d7b8e4f19\",\n    createdDate: \"2026-09-28T14:05:00Z\",\n  },\n  {\n    token: \"b2d94a17-0c6e-4e8b-a3f5-91d7c2e6a0b4\",\n    createdDate: \"2026-07-11T08:42:00Z\",\n  },\n  {\n    token: \"1e7a3c90-58f2-4b1d-8c64-2a9f0e3d7b51\",\n    createdDate: \"2025-12-02T16:20:00Z\",\n  },\n  {\n    token: \"9c4f2b68-d3a1-47e0-b5c9-6e8a1f2d3c70\",\n    createdDate: \"2025-03-19T10:11:00Z\",\n  },\n]\n\n// Stand-ins for the keys the server would create, used in turn.\nexport const MOCK_NEW_TOKENS = [\n  \"4a8e1d27-6b3f-4c90-8e15-7d2b9f0a6c38\",\n  \"e07b5c19-2d84-4f6a-a1c3-58e9d0b7f264\",\n  \"73d2f0a8-9e41-4b5c-86d7-1f3a2c9e0b85\",\n]",
      "type": "registry:lib",
      "target": "components/openlmis/service-accounts-page/mock-service-accounts.ts"
    },
    {
      "path": "registry/templates/openlmis/service-accounts-page/components/service-account-form-dialog/service-account-form-dialog.tsx",
      "content": "\"use client\"\n\nimport { AlertCircleIcon, KeyRoundIcon, Trash2Icon } from \"lucide-react\"\nimport { type ReactNode, useRef, useState } from \"react\"\n\nimport { Alert, AlertDescription, AlertTitle } from \"@/components/ui/alert\"\nimport {\n  AlertDialog,\n  AlertDialogCancel,\n  AlertDialogContent,\n  AlertDialogDescription,\n  AlertDialogFooter,\n  AlertDialogHeader,\n  AlertDialogMedia,\n  AlertDialogTitle,\n} from \"@/components/ui/alert-dialog\"\nimport { Button } from \"@/components/ui/button\"\nimport { Spinner } from \"@/components/ui/spinner\"\nimport {\n  CopyableValue,\n  type CopyState,\n} from \"@/components/openlmis/copyable-value\"\nimport { useDialogTarget } from \"@/components/openlmis/form-dialog/use-dialog-target\"\n\nimport type { ServiceAccount } from \"@/components/openlmis/service-accounts-page/service-account\"\n\nfunction DialogError({\n  title,\n  description,\n}: {\n  title: string\n  description: ReactNode\n}) {\n  return (\n    <Alert variant=\"destructive\">\n      <AlertCircleIcon />\n      <AlertTitle>{title}</AlertTitle>\n      <AlertDescription>{description}</AlertDescription>\n    </Alert>\n  )\n}\n\ntype AddServiceAccountDialogProps = CopyState & {\n  open: boolean\n  /** The account just added; the dialog then shows its key to copy. */\n  created?: ServiceAccount | undefined\n  /** Called on Add; add the account, then pass it back as `created`. */\n  onAdd: () => void\n  /** Keeps the dialog open and shows a spinner while the account is added. */\n  pending?: boolean\n  /** Why adding failed, e.g. \"Something went wrong. Check your connection and try again.\" */\n  error?: ReactNode\n  /** Called when the dialog closes; clear `created` and `error` here. */\n  onClose: () => void\n}\n\n/** Asks before adding an account, then shows its new key once to copy. */\nexport function AddServiceAccountDialog({\n  open,\n  created,\n  onAdd,\n  pending = false,\n  error,\n  onClose,\n  ...copy\n}: AddServiceAccountDialogProps) {\n  const { dialogProps } = useDialogTarget(open || undefined, onClose)\n  // Kept until the close animation ends, so the key stays on screen after the caller clears it.\n  const [key, setKey] = useState(created)\n  if (created && created !== key) setKey(created)\n  const props = dialogProps(pending)\n\n  return (\n    <AlertDialog\n      {...props}\n      onOpenChangeComplete={(next) => {\n        props.onOpenChangeComplete(next)\n        if (!next) setKey(undefined)\n      }}\n    >\n      <AlertDialogContent>\n        {key ? (\n          <>\n            <AlertDialogHeader>\n              <AlertDialogMedia>\n                <KeyRoundIcon />\n              </AlertDialogMedia>\n              <AlertDialogTitle>Service Account Added</AlertDialogTitle>\n              <AlertDialogDescription>\n                Copy the key into the system that will use it. It stays listed\n                here until you delete it.\n              </AlertDialogDescription>\n            </AlertDialogHeader>\n            <CopyableValue\n              copiedLabel=\"Key Copied\"\n              copyLabel=\"Copy Key\"\n              focusOnMount\n              value={key.token}\n              {...copy}\n            />\n            <AlertDialogFooter>\n              <Button onClick={onClose}>Done</Button>\n            </AlertDialogFooter>\n          </>\n        ) : (\n          <>\n            <AlertDialogHeader>\n              <AlertDialogMedia>\n                <KeyRoundIcon />\n              </AlertDialogMedia>\n              <AlertDialogTitle>Add A Service Account?</AlertDialogTitle>\n              <AlertDialogDescription>\n                OpenLMIS creates a new key. Any system that sends it can use the\n                API until the key is deleted.\n              </AlertDialogDescription>\n            </AlertDialogHeader>\n            {error && (\n              <DialogError\n                description={error}\n                title=\"Could Not Add Service Account\"\n              />\n            )}\n            <AlertDialogFooter>\n              <AlertDialogCancel disabled={pending}>Cancel</AlertDialogCancel>\n              <Button disabled={pending} focusableWhenDisabled onClick={onAdd}>\n                {pending && <Spinner data-icon=\"inline-start\" />}\n                Add Service Account\n              </Button>\n            </AlertDialogFooter>\n          </>\n        )}\n      </AlertDialogContent>\n    </AlertDialog>\n  )\n}\n\ntype DeleteServiceAccountDialogProps = CopyState & {\n  /** The key to delete; opens the dialog while set. */\n  token: string | undefined\n  /** Called on Delete; delete it, then clear `token` to close. */\n  onDelete: (token: string) => void\n  pending?: boolean\n  /** Why deleting failed. */\n  error?: ReactNode\n  onClose: () => void\n}\n\n/** Confirms deleting a key, which stops every system that uses it. */\nexport function DeleteServiceAccountDialog({\n  token,\n  onDelete,\n  pending = false,\n  error,\n  onClose,\n  ...copy\n}: DeleteServiceAccountDialogProps) {\n  const { shown, dialogProps } = useDialogTarget(token, onClose)\n  const cancelRef = useRef<HTMLButtonElement>(null)\n\n  return (\n    <AlertDialog {...dialogProps(pending)}>\n      {/* Cancel first, not the key's Copy button: deleting cannot be undone. */}\n      <AlertDialogContent initialFocus={cancelRef}>\n        <AlertDialogHeader>\n          <AlertDialogMedia>\n            <Trash2Icon />\n          </AlertDialogMedia>\n          <AlertDialogTitle>Delete This Service Account?</AlertDialogTitle>\n          <AlertDialogDescription>\n            Any system that uses this key stops working at once. This cannot be\n            undone.\n          </AlertDialogDescription>\n        </AlertDialogHeader>\n        {shown && (\n          <CopyableValue\n            copiedLabel=\"Key Copied\"\n            copyLabel=\"Copy Key\"\n            value={shown}\n            {...copy}\n          />\n        )}\n        {error && (\n          <DialogError\n            description={error}\n            title=\"Could Not Delete Service Account\"\n          />\n        )}\n        <AlertDialogFooter>\n          <AlertDialogCancel disabled={pending} ref={cancelRef}>\n            Cancel\n          </AlertDialogCancel>\n          <Button\n            disabled={pending}\n            focusableWhenDisabled\n            onClick={() => shown && onDelete(shown)}\n            variant=\"destructive\"\n          >\n            {pending && <Spinner data-icon=\"inline-start\" />}\n            Delete\n          </Button>\n        </AlertDialogFooter>\n      </AlertDialogContent>\n    </AlertDialog>\n  )\n}",
      "type": "registry:component",
      "target": "components/openlmis/service-accounts-page/service-account-form-dialog.tsx"
    },
    {
      "path": "registry/templates/openlmis/service-accounts-page/components/service-account.ts",
      "content": "/** An API key; `token` is the key an integration sends, and it never expires. */\nexport type ServiceAccount = {\n  token: string\n  /** When it was added, as an ISO date and time. */\n  createdDate: string\n}",
      "type": "registry:lib",
      "target": "components/openlmis/service-accounts-page/service-account.ts"
    },
    {
      "path": "registry/templates/openlmis/service-accounts-page/components/service-accounts-page.tsx",
      "content": "\"use client\"\n\nimport type { PaginationState } from \"@tanstack/react-table\"\nimport { KeyRoundIcon } from \"lucide-react\"\nimport { useCallback, useMemo, useRef, useState } from \"react\"\n\nimport type { ServiceAccount } from \"@/components/openlmis/service-accounts-page/service-account\"\nimport {\n  AddServiceAccountDialog,\n  DeleteServiceAccountDialog,\n} from \"@/components/openlmis/service-accounts-page/service-account-form-dialog\"\nimport {\n  ServiceAccountsTable,\n  ServiceAccountsToolbar,\n} from \"@/components/openlmis/service-accounts-page/service-accounts-table\"\nimport {\n  Workspace,\n  WorkspaceContent,\n  WorkspaceDescription,\n  WorkspaceHeader,\n  WorkspaceHeading,\n  WorkspaceIcon,\n  WorkspaceTitle,\n} from \"@/components/blocks/openlmis/workspace\"\nimport { Callout } from \"@/components/openlmis/callout\"\n\nimport { MOCK_NEW_TOKENS, MOCK_SERVICE_ACCOUNTS } from \"@/components/openlmis/service-accounts-page/mock-service-accounts\"\n\ntype Notice = {\n  tone: \"success\" | \"warning\"\n  title: string\n  description: string\n}\n\n/** The service accounts screen; mount it from any route, e.g. the `page.tsx` this template ships. */\nexport function ServiceAccountsPage() {\n  const [accounts, setAccounts] = useState(MOCK_SERVICE_ACCOUNTS)\n  const [newestFirst, setNewestFirst] = useState(true)\n  const [pagination, setPagination] = useState<PaginationState>({\n    pageIndex: 0,\n    pageSize: 10,\n  })\n  const [adding, setAdding] = useState(false)\n  const [created, setCreated] = useState<ServiceAccount>()\n  const [deleting, setDeleting] = useState<string>()\n  const [notice, setNotice] = useState<Notice>()\n  // Mocked copy: a real app writes to the clipboard in onCopy, then sets this.\n  const [copiedToken, setCopiedToken] = useState<string>()\n  // Counts every add, so a new key never repeats one already listed or deleted.\n  const added = useRef(0)\n\n  // Every account is in memory, so sorting and paging happen here.\n  const sorted = useMemo(\n    () =>\n      // oxlint-disable-next-line unicorn/no-array-sort -- sorts a copy\n      [...accounts].sort((a, b) =>\n        newestFirst\n          ? b.createdDate.localeCompare(a.createdDate)\n          : a.createdDate.localeCompare(b.createdDate)\n      ),\n    [accounts, newestFirst]\n  )\n  const lastPage = Math.max(\n    0,\n    Math.ceil(sorted.length / pagination.pageSize) - 1\n  )\n  // Deleting the last key on a page holds the table to the last page that exists.\n  const page = useMemo(\n    () => ({\n      ...pagination,\n      pageIndex: Math.min(pagination.pageIndex, lastPage),\n    }),\n    [pagination, lastPage]\n  )\n  const rows = useMemo(\n    () =>\n      sorted.slice(\n        page.pageIndex * page.pageSize,\n        (page.pageIndex + 1) * page.pageSize\n      ),\n    [sorted, page]\n  )\n\n  const openAdd = useCallback(() => {\n    setNotice(undefined)\n    setAdding(true)\n  }, [])\n  const openDelete = useCallback((token: string) => {\n    setNotice(undefined)\n    setDeleting(token)\n  }, [])\n  const onCopiedChange = useCallback((copied: boolean) => {\n    if (!copied) setCopiedToken(undefined)\n  }, [])\n  const changeSort = useCallback((next: boolean) => {\n    setNewestFirst(next)\n    setPagination((current) => ({ ...current, pageIndex: 0 }))\n  }, [])\n\n  const add = () => {\n    const count = added.current++\n    const base = MOCK_NEW_TOKENS[count % MOCK_NEW_TOKENS.length]\n    const round = Math.floor(count / MOCK_NEW_TOKENS.length)\n    const account = {\n      // Past the fixtures, the round number replaces the key's tail so it stays unique.\n      token:\n        round === 0 || !base\n          ? (base ?? `key-${count + 1}`)\n          : `${base.slice(0, -4)}${round.toString(16).padStart(4, \"0\")}`,\n      createdDate: new Date().toISOString(),\n    }\n    setAccounts((current) => [...current, account])\n    setCreated(account)\n  }\n  const remove = (token: string) => {\n    setAccounts((current) =>\n      current.filter((account) => account.token !== token)\n    )\n    setNotice({\n      tone: \"success\",\n      title: \"Service Account Deleted\",\n      description: `The key ${token} no longer works.`,\n    })\n    setDeleting(undefined)\n  }\n\n  return (\n    <Workspace>\n      <WorkspaceHeader>\n        <WorkspaceHeading>\n          <WorkspaceIcon>\n            <KeyRoundIcon />\n          </WorkspaceIcon>\n          <WorkspaceTitle>Service Accounts</WorkspaceTitle>\n          <WorkspaceDescription>\n            API keys that let other systems use the OpenLMIS API.\n          </WorkspaceDescription>\n        </WorkspaceHeading>\n      </WorkspaceHeader>\n      <WorkspaceContent>\n        <div className=\"flex flex-col gap-4 @4xl/main:gap-6\">\n          {notice && (\n            <Callout title={notice.title} tone={notice.tone}>\n              {notice.description}\n            </Callout>\n          )}\n          <ServiceAccountsToolbar onAdd={openAdd} />\n          <ServiceAccountsTable\n            accounts={rows}\n            newestFirst={newestFirst}\n            onAdd={openAdd}\n            copiedToken={copiedToken}\n            onCopy={setCopiedToken}\n            onCopiedChange={onCopiedChange}\n            onDelete={openDelete}\n            onNewestFirstChange={changeSort}\n            onPaginationChange={setPagination}\n            pagination={page}\n            rowCount={sorted.length}\n          />\n        </div>\n      </WorkspaceContent>\n      <AddServiceAccountDialog\n        created={created}\n        onAdd={add}\n        onClose={() => {\n          setAdding(false)\n          setCreated(undefined)\n        }}\n        copied={created !== undefined && copiedToken === created.token}\n        onCopy={setCopiedToken}\n        onCopiedChange={onCopiedChange}\n        open={adding}\n      />\n      <DeleteServiceAccountDialog\n        onClose={() => setDeleting(undefined)}\n        copied={deleting !== undefined && copiedToken === deleting}\n        onCopy={setCopiedToken}\n        onCopiedChange={onCopiedChange}\n        onDelete={remove}\n        token={deleting}\n      />\n    </Workspace>\n  )\n}",
      "type": "registry:component",
      "target": "components/openlmis/service-accounts-page/service-accounts-page.tsx"
    },
    {
      "path": "registry/templates/openlmis/service-accounts-page/components/service-accounts-table/service-accounts-table.tsx",
      "content": "\"use client\"\n\nimport {\n  createColumnHelper,\n  functionalUpdate,\n  type PaginationState,\n  useTable,\n} from \"@tanstack/react-table\"\nimport { EllipsisIcon, KeyRoundIcon, PlusIcon, Trash2Icon } from \"lucide-react\"\nimport { useMemo } from \"react\"\n\nimport { Button } from \"@/components/ui/button\"\nimport {\n  DropdownMenu,\n  DropdownMenuContent,\n  DropdownMenuItem,\n  DropdownMenuTrigger,\n} from \"@/components/ui/dropdown-menu\"\nimport {\n  DataTable,\n  DataTableColumnHeader,\n  DataTableEmpty,\n  DataTableError,\n  type DataTableFeatures,\n  DataTablePagination,\n  DataTableSkeleton,\n  dataTableFeatures,\n} from \"@/components/blocks/openlmis/data-table/data-table\"\nimport { useMenuOpensDialog } from \"@/components/blocks/openlmis/data-table/row-actions\"\nimport { ListToolbar } from \"@/components/blocks/openlmis/list-toolbar\"\nimport { CopyButton } from \"@/components/openlmis/copyable-value\"\n\nimport type { ServiceAccount } from \"@/components/openlmis/service-accounts-page/service-account\"\n\nconst columnHelper = createColumnHelper<DataTableFeatures, ServiceAccount>()\n\ntype RowActions = {\n  onDelete: ((token: string) => void) | undefined\n  copiedToken: string | undefined\n  onCopy: ((token: string) => void) | undefined\n  onCopiedChange: ((copied: boolean) => void) | undefined\n}\n\nfunction createColumns(\n  formatDate: (date: Date) => string,\n  { onDelete, copiedToken, onCopy, onCopiedChange }: RowActions\n) {\n  return columnHelper.columns([\n    columnHelper.accessor(\"createdDate\", {\n      header: ({ column }) => (\n        <DataTableColumnHeader column={column} title=\"Created\" />\n      ),\n      cell: ({ getValue }) => (\n        <span className=\"whitespace-normal\">\n          {formatDate(new Date(getValue()))}\n        </span>\n      ),\n      meta: { className: \"@xl/table:w-56\" },\n    }),\n    columnHelper.accessor(\"token\", {\n      header: ({ column }) => (\n        <DataTableColumnHeader column={column} title=\"Key\" />\n      ),\n      enableSorting: false,\n      cell: ({ getValue }) => (\n        <div className=\"flex items-center gap-1 whitespace-normal\">\n          <span className=\"font-mono text-sm break-all\" dir=\"ltr\">\n            {getValue()}\n          </span>\n          <CopyButton\n            copied={getValue() === copiedToken}\n            copiedLabel=\"Key Copied\"\n            copyLabel=\"Copy Key\"\n            onCopiedChange={onCopiedChange}\n            onCopy={onCopy}\n            value={getValue()}\n          />\n        </div>\n      ),\n    }),\n    ...(onDelete\n      ? [\n          columnHelper.display({\n            id: \"actions\",\n            header: () => <span className=\"sr-only\">Actions</span>,\n            cell: ({ row }) => (\n              <KeyActions onDelete={onDelete} token={row.original.token} />\n            ),\n            meta: { className: \"w-16\" },\n          }),\n        ]\n      : []),\n  ])\n}\n\nfunction KeyActions({\n  token,\n  onDelete,\n}: {\n  token: string\n  onDelete: (token: string) => void\n}) {\n  const menu = useMenuOpensDialog()\n\n  return (\n    <div className=\"flex justify-end\">\n      <DropdownMenu onOpenChange={menu.onOpenChange}>\n        <DropdownMenuTrigger\n          render={\n            <Button\n              aria-label={`Actions For Key ${token}`}\n              size=\"icon-sm\"\n              variant=\"ghost\"\n            />\n          }\n        >\n          <EllipsisIcon />\n        </DropdownMenuTrigger>\n        <DropdownMenuContent\n          align=\"end\"\n          className=\"w-auto\"\n          finalFocus={menu.finalFocus}\n        >\n          <DropdownMenuItem\n            onClick={menu.opensDialog(() => onDelete(token))}\n            variant=\"destructive\"\n          >\n            <Trash2Icon />\n            Delete\n          </DropdownMenuItem>\n        </DropdownMenuContent>\n      </DropdownMenu>\n    </div>\n  )\n}\n\nconst NO_KEYS: ServiceAccount[] = []\n\nconst getRowId = (account: ServiceAccount) => account.token\n\ntype ServiceAccountsTableProps = {\n  /** One page of accounts; a skeleton shows until it is set. */\n  accounts: readonly ServiceAccount[] | undefined\n  /** Every account, across all pages. */\n  rowCount: number\n  pagination: PaginationState\n  onPaginationChange: (pagination: PaginationState) => void\n  /** Newest first by default; sorting is left to the caller. */\n  newestFirst?: boolean\n  onNewestFirstChange?: (newestFirst: boolean) => void\n  /** Offered when there are no accounts. */\n  onAdd?: (() => void) | undefined\n  /** Without it, the row menu is left out. */\n  onDelete?: ((token: string) => void) | undefined\n  /** The key whose Copy button shows a tick. */\n  copiedToken?: string | undefined\n  /** Called on a key's Copy button; copy it, then pass it as `copiedToken`. */\n  onCopy?: ((token: string) => void) | undefined\n  /** Called with `false` when the copied key's button loses focus or the pointer. */\n  onCopiedChange?: ((copied: boolean) => void) | undefined\n  /** Dims the rows while the next page loads. */\n  isStale?: boolean\n  /** Loading failed; shows the error with Try Again. */\n  onRetry?: (() => void) | undefined\n  /** The language dates and times are shown in. */\n  dateLanguage?: string\n}\n\n/** API keys with when each was added, a page at a time; the caller must clamp `pageIndex` to the last page when rows shrink. */\nexport function ServiceAccountsTable({\n  accounts,\n  rowCount,\n  pagination,\n  onPaginationChange,\n  newestFirst = true,\n  onNewestFirstChange,\n  onAdd,\n  onDelete,\n  copiedToken,\n  onCopy,\n  onCopiedChange,\n  isStale = false,\n  onRetry,\n  dateLanguage = \"en-US\",\n}: ServiceAccountsTableProps) {\n  const formatDate = useMemo(\n    () =>\n      // UTC, named, so a server render and the browser print the same time.\n      new Intl.DateTimeFormat(dateLanguage, {\n        year: \"numeric\",\n        month: \"short\",\n        day: \"numeric\",\n        hour: \"numeric\",\n        minute: \"2-digit\",\n        timeZone: \"UTC\",\n        timeZoneName: \"short\",\n      }).format,\n    [dateLanguage]\n  )\n  const columns = useMemo(\n    () =>\n      createColumns(formatDate, {\n        onDelete,\n        copiedToken,\n        onCopy,\n        onCopiedChange,\n      }),\n    [formatDate, onDelete, copiedToken, onCopy, onCopiedChange]\n  )\n  // Memoized: the table compares controlled state by reference and would reset it every render.\n  const sorting = useMemo(\n    () => [{ id: \"createdDate\", desc: newestFirst }],\n    [newestFirst]\n  )\n  const table = useTable({\n    features: dataTableFeatures,\n    columns,\n    data: (accounts ?? NO_KEYS) as ServiceAccount[],\n    getRowId,\n    rowCount,\n    manualPagination: true,\n    manualSorting: true,\n    enableSortingRemoval: false,\n    enableSorting: Boolean(onNewestFirstChange),\n    state: { pagination, sorting },\n    onPaginationChange: (updater) =>\n      onPaginationChange(functionalUpdate(updater, pagination)),\n    onSortingChange: (updater) => {\n      const [next] = functionalUpdate(updater, sorting)\n      if (next) onNewestFirstChange?.(next.desc)\n    },\n  })\n\n  if (onRetry)\n    return (\n      <DataTableError\n        description=\"Something went wrong while loading the service accounts. Try again.\"\n        onRetry={onRetry}\n        title=\"Service Accounts Could Not Load\"\n      />\n    )\n  if (accounts === undefined)\n    return <DataTableSkeleton rowCount={pagination.pageSize} table={table} />\n\n  return (\n    <DataTable\n      empty={\n        <DataTableEmpty\n          action={\n            onAdd && (\n              <Button onClick={onAdd}>\n                <PlusIcon data-icon=\"inline-start\" />\n                Add Service Account\n              </Button>\n            )\n          }\n          description=\"Add one to give another system access to the API.\"\n          icon={<KeyRoundIcon />}\n          title=\"No Service Accounts\"\n        />\n      }\n      footer={rowCount > 0 && <DataTablePagination table={table} />}\n      isStale={isStale}\n      table={table}\n    />\n  )\n}\n\n/** The Add button above the table, at the end with room and full width without. */\nexport function ServiceAccountsToolbar({ onAdd }: { onAdd: () => void }) {\n  return (\n    <ListToolbar>\n      <div className=\"w-full @2xl/toolbar:ms-auto @2xl/toolbar:w-auto\">\n        <Button className=\"w-full\" onClick={onAdd}>\n          <PlusIcon data-icon=\"inline-start\" />\n          Add Service Account\n        </Button>\n      </div>\n    </ListToolbar>\n  )\n}",
      "type": "registry:component",
      "target": "components/openlmis/service-accounts-page/service-accounts-table.tsx"
    },
    {
      "path": "registry/templates/openlmis/service-accounts-page/page.tsx",
      "content": "import { ServiceAccountsPage } from \"@/components/openlmis/service-accounts-page/service-accounts-page\"\n\n// A Next.js App Router route; in any other React app, render ServiceAccountsPage from your own route.\nexport default function Page() {\n  return <ServiceAccountsPage />\n}",
      "type": "registry:page",
      "target": "app/service-accounts-page/page.tsx"
    }
  ],
  "cssVars": {
    "light": {
      "destructive": "oklch(0.577 0.245 27.325)",
      "destructive-foreground": "oklch(0.985 0 0)",
      "success": "oklch(0.596 0.145 163.225)",
      "success-foreground": "oklch(0.985 0 0)",
      "warning": "oklch(0.666 0.179 58.318)",
      "warning-foreground": "oklch(0.985 0 0)",
      "info": "oklch(0.55 0.13 237)",
      "info-foreground": "oklch(0.985 0 0)"
    },
    "dark": {
      "destructive": "oklch(0.704 0.191 22.216)",
      "destructive-foreground": "oklch(0.21 0.04 25)",
      "success": "oklch(0.696 0.17 162.48)",
      "success-foreground": "oklch(0.21 0.04 163)",
      "warning": "oklch(0.769 0.188 70.08)",
      "warning-foreground": "oklch(0.22 0.04 60)",
      "info": "oklch(0.7 0.14 237)",
      "info-foreground": "oklch(0.2 0.04 240)"
    }
  },
  "meta": {
    "project": "openlmis",
    "height": "459px"
  },
  "docs": "Requires a `base-*` style in components.json (the `shadcn init` default). Legacy `new-york`/`radix-*` styles install Radix primitives, which reject the `render` prop this item uses.",
  "categories": [
    "administration"
  ],
  "type": "registry:page"
}
