{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "connector-marketplace",
  "type": "registry:block",
  "title": "Connector Marketplace",
  "description": "A place to browse the apps that plug into your product: filter by category, search, and connect one through a short permissions step that shows the link being made.",
  "categories": [
    "block",
    "Apps"
  ],
  "dependencies": [
    "lucide-react",
    "motion"
  ],
  "registryDependencies": [
    "utils",
    "https://coss.com/ui/r/button.json",
    "https://coss.com/ui/r/input-group.json",
    "https://coss.com/ui/r/spinner.json"
  ],
  "files": [
    {
      "path": "registry/devl/connector-marketplace.tsx",
      "type": "registry:component",
      "content": "\"use client\";\n\nimport {\n  CheckIcon,\n  LayoutGridIcon,\n  type LucideIcon,\n  SearchIcon,\n  ShieldCheckIcon,\n  StarIcon,\n  XIcon,\n} from \"lucide-react\";\nimport { AnimatePresence, LayoutGroup, motion, useReducedMotion } from \"motion/react\";\nimport { useEffect, useId, useRef, useState } from \"react\";\nimport { Button } from \"@/components/ui/button\";\nimport { InputGroup, InputGroupAddon, InputGroupInput } from \"@/components/ui/input-group\";\nimport { Spinner } from \"@/components/ui/spinner\";\nimport { cn } from \"@/lib/utils\";\n\nexport type AppTone = \"blue\" | \"green\" | \"amber\" | \"red\" | \"neutral\";\n\nexport interface MarketplaceCategory {\n  id: string;\n  label: string;\n  icon: LucideIcon;\n}\n\nexport interface MarketplaceApp {\n  id: string;\n  name: string;\n  category: string;\n  description: string;\n  icon: LucideIcon;\n  tone: AppTone;\n  rating: number;\n  installs: string;\n  pricing: \"free\" | \"paid\";\n  isNew?: boolean;\n  connected?: boolean;\n  permissions?: string[];\n}\n\nexport interface ConnectorMarketplaceProps {\n  apps: MarketplaceApp[];\n  categories: MarketplaceCategory[];\n  workspace?: { name: string; initial?: string };\n  onConnectionChange?: (appId: string, connected: boolean) => void;\n  className?: string;\n}\n\ntype Status = \"idle\" | \"connecting\" | \"connected\";\ntype Phase = \"review\" | \"authorizing\" | \"syncing\" | \"done\";\n\nconst toneClass: Record<AppTone, string> = {\n  blue: \"bg-blue-500 text-white\",\n  green: \"bg-emerald-500 text-white\",\n  amber: \"bg-amber-500 text-white\",\n  red: \"bg-rose-500 text-white\",\n  neutral: \"bg-foreground text-background\",\n};\nconst press = \"transition-[box-shadow,background-color,transform] duration-150 ease-out active:scale-[0.97]\";\n\nfunction AppTile({ app, size = \"md\" }: { app: MarketplaceApp; size?: \"md\" | \"lg\" }) {\n  return (\n    <span\n      className={cn(\n        \"relative flex shrink-0 items-center justify-center overflow-hidden shadow-xs/5 before:absolute before:inset-0 before:bg-linear-to-b before:from-white/20 before:to-transparent [&_svg]:relative\",\n        toneClass[app.tone],\n        size === \"lg\" ? \"size-14 rounded-2xl [&_svg]:size-7\" : \"size-10 rounded-xl [&_svg]:size-5\",\n      )}\n    >\n      <app.icon />\n    </span>\n  );\n}\n\nfunction ConnectBridge({ phase, app, workspace }: { phase: Phase; app: MarketplaceApp; workspace: string }) {\n  const reduce = useReducedMotion();\n  const flowing = phase === \"authorizing\" || phase === \"syncing\";\n  const done = phase === \"done\";\n  return (\n    <div className=\"flex items-center gap-3\">\n      <AppTile app={app} size=\"lg\" />\n      <div aria-hidden className=\"relative h-14 flex-1\">\n        <span\n          className={cn(\n            \"absolute top-1/2 left-0 size-2 -translate-y-1/2 rounded-full transition-colors duration-300\",\n            done ? \"bg-success\" : \"bg-border\",\n          )}\n        />\n        <span\n          className={cn(\n            \"absolute top-1/2 right-0 size-2 -translate-y-1/2 rounded-full transition-colors duration-300\",\n            done ? \"bg-success\" : \"bg-border\",\n          )}\n        />\n        <span className=\"absolute inset-x-3 top-1/2 -translate-y-1/2 border-t-2 border-dashed\" />\n        <motion.span\n          animate={{ scaleX: done ? 1 : 0 }}\n          className=\"absolute inset-x-1 top-1/2 h-0.5 origin-left -translate-y-1/2 rounded-full bg-success\"\n          initial={false}\n          transition={reduce ? { duration: 0 } : { type: \"spring\", stiffness: 180, damping: 26 }}\n        />\n        <div className=\"absolute inset-x-3 top-1/2 -translate-y-1/2\">\n          {flowing &&\n            !reduce &&\n            [0, 1, 2].map((i) => (\n              <motion.span\n                animate={{ x: [\"0%\", \"100%\"], opacity: [0, 1, 1, 0] }}\n                className=\"absolute inset-x-0 top-1/2\"\n                initial={{ x: \"0%\", opacity: 0 }}\n                key={i}\n                transition={{\n                  duration: 1.2,\n                  repeat: Number.POSITIVE_INFINITY,\n                  delay: i * 0.4,\n                  ease: \"easeInOut\",\n                  opacity: { duration: 1.2, times: [0, 0.15, 0.85, 1], repeat: Number.POSITIVE_INFINITY, delay: i * 0.4 },\n                }}\n              >\n                <span className=\"absolute top-0 left-0 size-1.5 -translate-x-1/2 -translate-y-1/2 rounded-full bg-foreground\" />\n              </motion.span>\n            ))}\n        </div>\n        <AnimatePresence>\n          {done && (\n            <motion.span\n              animate={{ scale: 1, opacity: 1 }}\n              className=\"absolute top-1/2 left-1/2 -mt-3.5 -ml-3.5 flex size-7 items-center justify-center rounded-full bg-success text-white ring-4 ring-popover\"\n              initial={{ scale: 0.5, opacity: 0 }}\n              transition={reduce ? { duration: 0 } : { type: \"spring\", stiffness: 500, damping: 30, delay: 0.12 }}\n            >\n              <CheckIcon className=\"size-4\" strokeWidth={3} />\n            </motion.span>\n          )}\n        </AnimatePresence>\n      </div>\n      <span className=\"flex size-14 shrink-0 items-center justify-center rounded-2xl bg-primary font-semibold text-lg text-primary-foreground shadow-xs/5\">\n        {workspace.slice(0, 1)}\n      </span>\n    </div>\n  );\n}\n\nfunction ConnectDialog({\n  app,\n  workspace,\n  onClose,\n  onConnected,\n}: {\n  app: MarketplaceApp;\n  workspace: string;\n  onClose: () => void;\n  onConnected: () => void;\n}) {\n  const reduce = useReducedMotion();\n  const [phase, setPhase] = useState<Phase>(\"review\");\n  const primaryRef = useRef<HTMLButtonElement>(null);\n  const timers = useRef<ReturnType<typeof setTimeout>[]>([]);\n  const permissions = app.permissions ?? [\"Read workspace members\", \"Create and update records\", \"Send notifications\"];\n\n  useEffect(() => {\n    primaryRef.current?.focus();\n    const list = timers.current;\n    return () => list.forEach(clearTimeout);\n  }, []);\n\n  const authorize = () => {\n    const pace = reduce ? 0.3 : 1;\n    setPhase(\"authorizing\");\n    timers.current.push(setTimeout(() => setPhase(\"syncing\"), 1100 * pace));\n    timers.current.push(\n      setTimeout(() => {\n        setPhase(\"done\");\n        onConnected();\n      }, 2300 * pace),\n    );\n    timers.current.push(setTimeout(onClose, 3500 * pace));\n  };\n\n  const steps: { key: Phase; label: string }[] = [\n    { key: \"authorizing\", label: \"Authorizing access\" },\n    { key: \"syncing\", label: \"Syncing your data\" },\n    { key: \"done\", label: \"Connected\" },\n  ];\n  const order: Phase[] = [\"review\", \"authorizing\", \"syncing\", \"done\"];\n  const at = order.indexOf(phase);\n\n  return (\n    <motion.div\n      animate={{ opacity: 1, scale: 1, y: 0 }}\n      aria-label={`Connect ${app.name}`}\n      aria-modal=\"true\"\n      className=\"relative z-10 w-full max-w-sm rounded-2xl border bg-popover p-5 text-popover-foreground shadow-xs/5\"\n      exit={{ opacity: 0, scale: 0.97, y: 4, transition: { duration: 0.15, ease: \"easeOut\" } }}\n      initial={{ opacity: 0, scale: 0.96, y: 8 }}\n      onKeyDown={(e) => {\n        if (e.key === \"Escape\" && phase === \"review\") onClose();\n      }}\n      role=\"dialog\"\n      transition={reduce ? { duration: 0 } : { type: \"spring\", stiffness: 480, damping: 40 }}\n    >\n      {phase === \"review\" && (\n        <button\n          aria-label=\"Close\"\n          className=\"absolute top-3 right-3 inline-flex size-8 cursor-pointer items-center justify-center rounded-lg text-muted-foreground outline-none transition-[color,background-color,transform] duration-150 ease-out hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring active:scale-[0.97]\"\n          onClick={onClose}\n          type=\"button\"\n        >\n          <XIcon className=\"size-4\" />\n        </button>\n      )}\n      <div className=\"pt-6\">\n        <ConnectBridge app={app} phase={phase} workspace={workspace} />\n      </div>\n      <h3 className=\"mt-5 font-semibold text-base\">\n        {phase === \"done\" ? `${app.name} is connected` : `Connect ${app.name} to ${workspace}`}\n      </h3>\n      <AnimatePresence initial={false} mode=\"wait\">\n        {phase === \"review\" ? (\n          <motion.div animate={{ opacity: 1 }} exit={{ opacity: 0 }} initial={{ opacity: 0 }} key=\"review\">\n            <p className=\"mt-1 text-muted-foreground text-sm\">{app.name} will be able to:</p>\n            <ul className=\"mt-3 space-y-2 text-sm\">\n              {permissions.map((p) => (\n                <li className=\"flex items-center gap-2\" key={p}>\n                  <ShieldCheckIcon className=\"size-4 shrink-0 text-success-foreground\" />\n                  {p}\n                </li>\n              ))}\n            </ul>\n            <div className=\"mt-5 flex gap-2\">\n              <Button className={cn(\"flex-1\", press)} onClick={onClose} variant=\"outline\">\n                Cancel\n              </Button>\n              <Button className={cn(\"flex-1\", press)} onClick={authorize} ref={primaryRef}>\n                Authorize\n              </Button>\n            </div>\n          </motion.div>\n        ) : (\n          <motion.ol\n            animate={{ opacity: 1 }}\n            aria-live=\"polite\"\n            className=\"mt-3 space-y-2.5 text-sm\"\n            exit={{ opacity: 0 }}\n            initial={{ opacity: 0 }}\n            key=\"steps\"\n          >\n            {steps.map((s, i) => {\n              const state = at > i + 1 || phase === \"done\" ? \"done\" : at === i + 1 ? \"active\" : \"todo\";\n              return (\n                <li className=\"flex items-center gap-2.5\" key={s.key}>\n                  <span\n                    className={cn(\n                      \"flex size-5 items-center justify-center rounded-full transition-colors duration-300\",\n                      state === \"done\" ? \"bg-success text-white\" : state === \"active\" ? \"bg-accent\" : \"bg-muted\",\n                    )}\n                  >\n                    {state === \"done\" ? (\n                      <CheckIcon className=\"size-3\" strokeWidth={3} />\n                    ) : state === \"active\" ? (\n                      <Spinner className=\"size-3\" />\n                    ) : null}\n                  </span>\n                  <span className={cn(state === \"todo\" && \"text-muted-foreground\")}>{s.label}</span>\n                </li>\n              );\n            })}\n          </motion.ol>\n        )}\n      </AnimatePresence>\n    </motion.div>\n  );\n}\n\nfunction ConnectButton({ status, onConnect, onDisconnect }: { status: Status; onConnect: () => void; onDisconnect: () => void }) {\n  if (status === \"connecting\") {\n    return (\n      <Button disabled size=\"sm\" variant=\"outline\">\n        <Spinner className=\"size-3.5\" />\n        Connecting\n      </Button>\n    );\n  }\n  if (status === \"connected\") {\n    return (\n      <button\n        aria-label=\"Connected. Click to disconnect\"\n        className=\"group/conn relative inline-flex h-8 cursor-pointer items-center gap-1.5 overflow-hidden rounded-lg bg-success/10 px-2.5 font-medium text-sm text-success-foreground outline-none transition-[color,background-color,transform] duration-150 ease-out hover:bg-destructive/10 hover:text-destructive-foreground focus-visible:ring-2 focus-visible:ring-ring active:scale-[0.97] sm:h-7 sm:text-xs\"\n        onClick={onDisconnect}\n        type=\"button\"\n      >\n        <span className=\"size-1.5 rounded-full bg-success transition-colors duration-150 group-hover/conn:bg-destructive\" />\n        <span className=\"grid\">\n          <span className=\"[grid-area:1/1] group-hover/conn:invisible\">Connected</span>\n          <span className=\"invisible [grid-area:1/1] group-hover/conn:visible\">Disconnect</span>\n        </span>\n      </button>\n    );\n  }\n  return (\n    <Button className={press} onClick={onConnect} size=\"sm\" variant=\"outline\">\n      Connect\n    </Button>\n  );\n}\n\nexport function ConnectorMarketplace({\n  apps,\n  categories,\n  workspace = { name: \"Acme Labs\" },\n  onConnectionChange,\n  className,\n}: ConnectorMarketplaceProps) {\n  const uid = useId().replace(/:/g, \"\");\n  const reduce = useReducedMotion();\n  const [category, setCategory] = useState(\"all\");\n  const [query, setQuery] = useState(\"\");\n  const [filters, setFilters] = useState({ connected: false, free: false, isNew: false });\n  const [sort, setSort] = useState<\"popular\" | \"az\">(\"popular\");\n  const [status, setStatus] = useState<Record<string, Status>>(() =>\n    Object.fromEntries(apps.map((a) => [a.id, a.connected ? \"connected\" : \"idle\"])),\n  );\n  const [dialogApp, setDialogApp] = useState<MarketplaceApp | null>(null);\n  const returnFocus = useRef<HTMLElement | null>(null);\n\n  const setAppStatus = (id: string, s: Status) => {\n    setStatus((prev) => ({ ...prev, [id]: s }));\n    if (s !== \"connecting\") onConnectionChange?.(id, s === \"connected\");\n  };\n\n  const q = query.trim().toLowerCase();\n  const visible = apps\n    .filter((a) => category === \"all\" || a.category === category)\n    .filter((a) => !q || a.name.toLowerCase().includes(q) || a.description.toLowerCase().includes(q))\n    .filter((a) => !filters.connected || status[a.id] === \"connected\")\n    .filter((a) => !filters.free || a.pricing === \"free\")\n    .filter((a) => !filters.isNew || a.isNew)\n    .sort((a, b) => (sort === \"az\" ? a.name.localeCompare(b.name) : b.rating - a.rating));\n\n  const connectedCount = Object.values(status).filter((s) => s === \"connected\").length;\n  const allCategories: MarketplaceCategory[] = [{ id: \"all\", label: \"All apps\", icon: LayoutGridIcon }, ...categories];\n  const countFor = (id: string) => (id === \"all\" ? apps.length : apps.filter((a) => a.category === id).length);\n  const spring = reduce ? { duration: 0 } : ({ type: \"spring\", stiffness: 480, damping: 42 } as const);\n\n  const closeDialog = () => {\n    if (dialogApp) {\n      const id = dialogApp.id;\n      setStatus((prev) => (prev[id] === \"connecting\" ? { ...prev, [id]: \"idle\" } : prev));\n    }\n    setDialogApp(null);\n    requestAnimationFrame(() => returnFocus.current?.focus());\n  };\n\n  return (\n    <LayoutGroup id={uid}>\n      <div\n        className={cn(\n          \"relative isolate mx-auto flex h-[720px] w-full max-w-[1100px] overflow-hidden rounded-2xl border bg-card\",\n          className,\n        )}\n      >\n        <nav aria-label=\"Categories\" className=\"hidden w-56 shrink-0 flex-col border-e bg-muted/40 p-3 md:flex\">\n          <p className=\"px-2 pt-1 pb-3 font-semibold text-sm\">Integrations</p>\n          <ul className=\"space-y-0.5\">\n            {allCategories.map((c) => {\n              const active = category === c.id;\n              return (\n                <li key={c.id}>\n                  <button\n                    aria-current={active ? \"page\" : undefined}\n                    className={cn(\n                      \"relative flex h-8 w-full cursor-pointer items-center gap-2.5 rounded-lg px-2 text-sm outline-none transition-colors duration-150 focus-visible:ring-2 focus-visible:ring-ring\",\n                      active ? \"font-medium text-foreground\" : \"text-muted-foreground hover:text-foreground\",\n                    )}\n                    onClick={() => setCategory(c.id)}\n                    type=\"button\"\n                  >\n                    {active && (\n                      <motion.span\n                        className=\"absolute inset-0 rounded-lg bg-background shadow-xs/5 dark:bg-accent\"\n                        layoutId=\"category-pill\"\n                        transition={spring}\n                      />\n                    )}\n                    <c.icon className=\"relative size-4\" />\n                    <span className=\"relative flex-1 text-start\">{c.label}</span>\n                    <span className=\"relative text-muted-foreground text-xs tabular-nums\">{countFor(c.id)}</span>\n                  </button>\n                </li>\n              );\n            })}\n          </ul>\n          <div className=\"mt-auto rounded-xl border bg-card p-3\">\n            <p className=\"text-muted-foreground text-xs\">Connected to {workspace.name}</p>\n            <p className=\"mt-1 font-semibold text-2xl tabular-nums\">\n              <AnimatePresence initial={false} mode=\"popLayout\">\n                <motion.span\n                  animate={{ y: 0, opacity: 1 }}\n                  className=\"inline-block\"\n                  exit={{ y: -12, opacity: 0 }}\n                  initial={{ y: 12, opacity: 0 }}\n                  key={connectedCount}\n                  transition={spring}\n                >\n                  {connectedCount}\n                </motion.span>\n              </AnimatePresence>\n              <span className=\"font-normal text-muted-foreground text-sm\"> / {apps.length} apps</span>\n            </p>\n          </div>\n        </nav>\n\n        <div className=\"@container flex min-w-0 flex-1 flex-col\">\n          <div className=\"space-y-3 border-b p-3 sm:p-4\">\n            <div className=\"flex flex-wrap items-center gap-2\">\n              <InputGroup className=\"min-w-0 flex-1 sm:max-w-xs\">\n                <InputGroupAddon>\n                  <SearchIcon />\n                </InputGroupAddon>\n                <InputGroupInput\n                  aria-label=\"Search apps\"\n                  onChange={(e) => setQuery(e.target.value)}\n                  placeholder=\"Search apps\"\n                  type=\"search\"\n                  value={query}\n                />\n              </InputGroup>\n              <div aria-label=\"Sort\" className=\"ms-auto inline-flex rounded-lg border bg-muted p-0.5\" role=\"radiogroup\">\n                {(\n                  [\n                    { value: \"popular\", label: \"Top rated\" },\n                    { value: \"az\", label: \"A–Z\" },\n                  ] as const\n                ).map((o) => (\n                  <button\n                    aria-checked={sort === o.value}\n                    className={cn(\n                      \"relative h-7 cursor-pointer rounded-md px-2.5 font-medium text-xs outline-none transition-colors duration-150 after:absolute after:-inset-y-0.5 after:inset-x-0 after:content-[''] focus-visible:ring-2 focus-visible:ring-ring\",\n                      sort === o.value ? \"text-foreground\" : \"text-muted-foreground hover:text-foreground\",\n                    )}\n                    key={o.value}\n                    onClick={() => setSort(o.value)}\n                    role=\"radio\"\n                    type=\"button\"\n                  >\n                    {sort === o.value && (\n                      <motion.span\n                        className=\"absolute inset-0 rounded-md bg-background shadow-xs/5 dark:bg-accent\"\n                        layoutId=\"sort-pill\"\n                        transition={spring}\n                      />\n                    )}\n                    <span className=\"relative\">{o.label}</span>\n                  </button>\n                ))}\n              </div>\n            </div>\n            <div className=\"-mx-1 flex gap-1.5 overflow-x-auto px-1 pb-0.5\">\n              <div className=\"flex gap-1.5 md:hidden\">\n                {allCategories.map((c) => (\n                  <button\n                    aria-pressed={category === c.id}\n                    className={cn(\n                      \"inline-flex h-8 shrink-0 cursor-pointer items-center gap-1.5 rounded-full border px-3 text-xs outline-none transition-colors duration-150 focus-visible:ring-2 focus-visible:ring-ring\",\n                      category === c.id ? \"border-primary bg-primary text-primary-foreground\" : \"text-muted-foreground\",\n                    )}\n                    key={c.id}\n                    onClick={() => setCategory(c.id)}\n                    type=\"button\"\n                  >\n                    <c.icon className=\"size-3.5\" />\n                    {c.label}\n                  </button>\n                ))}\n                <span className=\"mx-1 w-px shrink-0 bg-border\" />\n              </div>\n              {(\n                [\n                  { key: \"connected\", label: \"Connected\" },\n                  { key: \"free\", label: \"Free\" },\n                  { key: \"isNew\", label: \"New\" },\n                ] as const\n              ).map((f) => (\n                <button\n                  aria-pressed={filters[f.key]}\n                  className={cn(\n                    \"inline-flex h-8 shrink-0 cursor-pointer items-center gap-1 rounded-full border px-3 text-xs outline-none transition-colors duration-150 focus-visible:ring-2 focus-visible:ring-ring md:h-7 md:px-2.5\",\n                    filters[f.key] ? \"border-foreground/24 bg-accent font-medium text-foreground\" : \"text-muted-foreground hover:bg-accent/60\",\n                  )}\n                  key={f.key}\n                  onClick={() => setFilters((prev) => ({ ...prev, [f.key]: !prev[f.key] }))}\n                  type=\"button\"\n                >\n                  <AnimatePresence initial={false}>\n                    {filters[f.key] && (\n                      <motion.span\n                        animate={{ width: \"auto\", opacity: 1 }}\n                        className=\"overflow-hidden\"\n                        exit={{ width: 0, opacity: 0 }}\n                        initial={{ width: 0, opacity: 0 }}\n                        transition={reduce ? { duration: 0 } : { duration: 0.16, ease: [0.23, 1, 0.32, 1] }}\n                      >\n                        <CheckIcon className=\"size-3\" strokeWidth={3} />\n                      </motion.span>\n                    )}\n                  </AnimatePresence>\n                  {f.label}\n                </button>\n              ))}\n            </div>\n          </div>\n\n          <div className=\"min-h-0 flex-1 overflow-y-auto p-3 sm:p-4\">\n            <motion.ul className=\"grid gap-3 @xl:grid-cols-2 @3xl:grid-cols-3\" layout={!reduce}>\n              <AnimatePresence initial={false} mode=\"popLayout\">\n                {visible.map((app) => (\n                  <motion.li\n                    animate={{ opacity: 1, scale: 1 }}\n                    className=\"flex flex-col rounded-2xl border bg-card p-4 shadow-xs/5\"\n                    exit={{ opacity: 0, scale: 0.96 }}\n                    initial={{ opacity: 0, scale: 0.96 }}\n                    key={app.id}\n                    layout={!reduce}\n                    transition={spring}\n                  >\n                    <div className=\"flex items-start gap-3\">\n                      <AppTile app={app} />\n                      <div className=\"min-w-0 flex-1\">\n                        <div className=\"flex items-center gap-1.5\">\n                          <h3 className=\"truncate font-medium text-sm\">{app.name}</h3>\n                          {app.isNew && (\n                            <span className=\"rounded-full bg-info/10 px-1.5 py-px font-medium text-[0.625rem] text-info-foreground\">\n                              New\n                            </span>\n                          )}\n                        </div>\n                        <p className=\"text-muted-foreground text-xs\">\n                          {categories.find((c) => c.id === app.category)?.label ?? app.category}\n                        </p>\n                      </div>\n                      <span\n                        className={cn(\n                          \"rounded-full px-1.5 py-px font-medium text-xs\",\n                          app.pricing === \"free\" ? \"bg-success/10 text-success-foreground\" : \"bg-muted text-muted-foreground\",\n                        )}\n                      >\n                        {app.pricing === \"free\" ? \"Free\" : \"Paid\"}\n                      </span>\n                    </div>\n                    <p className=\"mt-3 line-clamp-2 text-pretty text-muted-foreground text-sm\">{app.description}</p>\n                    <div className=\"mt-auto flex items-center gap-3 pt-3 text-muted-foreground text-xs\">\n                      <span className=\"inline-flex items-center gap-1 tabular-nums\">\n                        <StarIcon className=\"size-3.5 text-warning\" fill=\"currentColor\" strokeWidth={0} />\n                        {app.rating.toFixed(1)}\n                      </span>\n                      <span className=\"tabular-nums\">{app.installs} installs</span>\n                      <span className=\"ms-auto\">\n                        <ConnectButton\n                          onConnect={() => {\n                            returnFocus.current = document.activeElement as HTMLElement | null;\n                            setAppStatus(app.id, \"connecting\");\n                            setDialogApp(app);\n                          }}\n                          onDisconnect={() => setAppStatus(app.id, \"idle\")}\n                          status={status[app.id] ?? \"idle\"}\n                        />\n                      </span>\n                    </div>\n                  </motion.li>\n                ))}\n              </AnimatePresence>\n            </motion.ul>\n            {visible.length === 0 && (\n              <div className=\"flex h-60 flex-col items-center justify-center gap-2 text-center\">\n                <span className=\"flex size-10 items-center justify-center rounded-xl bg-muted\">\n                  <SearchIcon className=\"size-5 text-muted-foreground\" />\n                </span>\n                <p className=\"font-medium text-sm\">No apps match</p>\n                <p className=\"text-muted-foreground text-xs\">Try another category or clear the filters.</p>\n                <Button\n                  className=\"mt-1\"\n                  onClick={() => {\n                    setQuery(\"\");\n                    setFilters({ connected: false, free: false, isNew: false });\n                    setCategory(\"all\");\n                  }}\n                  size=\"sm\"\n                  variant=\"outline\"\n                >\n                  Clear all\n                </Button>\n              </div>\n            )}\n          </div>\n        </div>\n\n        <AnimatePresence>\n          {dialogApp && (\n            <motion.div\n              animate={{ opacity: 1 }}\n              className=\"absolute inset-0 z-20 flex items-start justify-center p-4 pt-24 sm:pt-32\"\n              exit={{ opacity: 0 }}\n              initial={{ opacity: 0 }}\n              key=\"dialog\"\n            >\n              <div aria-hidden className=\"absolute inset-0 bg-background/60 backdrop-blur-[2px]\" onClick={closeDialog} />\n              <ConnectDialog\n                app={dialogApp}\n                onClose={closeDialog}\n                onConnected={() => setAppStatus(dialogApp.id, \"connected\")}\n                workspace={workspace.name}\n              />\n            </motion.div>\n          )}\n        </AnimatePresence>\n      </div>\n    </LayoutGroup>\n  );\n}\n"
    }
  ]
}