{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "The links of a top bar in a row; the current one carries aria-current. side: all, or the first or second half of the list.",
  "devDependencies": [],
  "digest": "0.1.0",
  "files": [
    {
      "content": "// Code generated by packages/kit-compose/src/server-organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.\n// Source: packages/compose-gen/specs/organisms/nav-links.json\n\npackage blocks\n\nimport (\n\t\"github.com/ui8kit/codegen/generated/templ/ui/box\"\n\t\"github.com/ui8kit/codegen/generated/templ/compose\"\n\tuiutils \"github.com/ui8kit/codegen/generated/templ/orgutils\"\n)\n\n// NavLinksProps are the props of NavLinks; the values are the JSON shapes of the TypeScript props.\ntype NavLinksProps struct {\n\tLinks any `json:\"links\"`\n\tCurrent any `json:\"current\"`\n\tSide any `json:\"side\"`\n}\n\n// The links of a top bar in a row; the current one carries aria-current. side: all, or the first or second half of the list.\ntempl NavLinks(p NavLinksProps) {\n\t{{ vLinks := p.Links }}\n\t{{ vCurrent := uiutils.Def(p.Current, \"\") }}\n\t{{ vSide := uiutils.Def(p.Side, \"all\") }}\n\t{{ vCount := any(uiutils.Len(vLinks)) }}\n\tif uiutils.Gt(uiutils.Len(vLinks), float64(0)) {\n\t\t@compose.Group(compose.GroupProps{Gap: \"4\", Align: \"center\", BoxProps: box.BoxProps{Class: \"flex-wrap\", Attrs: uiutils.Attrs(\"data-slot\", \"nav-links\")}}) {\n\t\t\tfor vI, vL := range uiutils.L(vLinks) {\n\t\t\t\tif uiutils.T(uiutils.Or(uiutils.Eq(vSide, \"all\"), uiutils.Eq(uiutils.Lt(uiutils.Mul(float64(vI), float64(2)), vCount), uiutils.Eq(vSide, \"left\")))) {\n\t\t\t\t\t@MenuEntry(MenuEntryProps{Href: uiutils.Get(vL, \"href\"), Class: uiutils.Cnv(\"text-sm\"), Current: uiutils.Eq(uiutils.Get(vL, \"id\"), vCurrent), Testid: \"nav-link\"}) {\n\t\t\t\t\t\t{ uiutils.Text(uiutils.Get(vL, \"name\")) }\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n",
      "path": "blocks/nav-links.templ",
      "target": "blocks/nav-links.templ"
    }
  ],
  "meta": {
    "category": "components",
    "kind": "component",
    "tags": [
      "templ",
      "component"
    ]
  },
  "name": "nav-links",
  "registryDependencies": [
    "group",
    "kit-box",
    "menu-entry",
    "utils"
  ],
  "runtime": "templ",
  "title": "Nav Links",
  "type": "registry:component"
}
