{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "popover-11",
  "type": "registry:component",
  "title": "Popover 11",
  "description": "Popover 11. Popovers are used to display rich content within an overlay that is triggered by a button click.",
  "dependencies": [
    "lucide-react"
  ],
  "registryDependencies": [
    "button",
    "popover"
  ],
  "files": [
    {
      "path": "components/watermelon/popover-11.tsx",
      "type": "registry:component",
      "content": "'use client';\n\nimport { useState } from 'react';\n\nimport {\n  BellIcon,\n  CheckCheckIcon,\n  Settings2Icon,\n  ClockIcon,\n  RocketIcon,\n  ShieldAlertIcon,\n  CloudCheckIcon,\n} from 'lucide-react';\n\nimport { Button } from '@/components/base-ui/button';\nimport {\n  Popover,\n  PopoverContent,\n  PopoverTrigger,\n} from '@/components/base-ui/popover';\nimport { cn } from '@/lib/utils';\n\nconst notifications = [\n  {\n    id: 1,\n    icon: RocketIcon,\n    message: 'Production deployment #842 successful',\n    category: 'System',\n    color: 'bg-emerald-500/10 text-emerald-600 dark:text-emerald-500',\n    time: '12 min',\n  },\n  {\n    id: 2,\n    icon: ShieldAlertIcon,\n    message: 'Unauthorized access attempt blocked',\n    category: 'Security',\n    color: 'bg-red-500/10 text-red-600 dark:text-red-500',\n    time: '45 min',\n  },\n  {\n    id: 3,\n    icon: CloudCheckIcon,\n    message: 'Architecture backup completed successfully',\n    category: 'Backup',\n    color: 'bg-blue-500/10 text-blue-600 dark:text-blue-500',\n    time: '2 hours',\n  },\n];\n\nconst Popover11 = () => {\n  const [readMessages, setReadMessages] = useState([3]);\n\n  return (\n    <Popover>\n      <PopoverTrigger asChild>\n        <Button\n          variant=\"outline\"\n          size=\"icon\"\n          className=\"group rounded-xl border-neutral-200 transition-all hover:bg-neutral-50 active:scale-95 dark:border-neutral-800 dark:hover:bg-neutral-900\"\n        >\n          <BellIcon className=\"size-4 text-neutral-500 transition-transform group-hover:scale-110\" />\n          <span className=\"sr-only\">Notifications</span>\n        </Button>\n      </PopoverTrigger>\n      <PopoverContent className=\"w-80 overflow-hidden rounded-3xl border border-neutral-100 bg-white p-0 shadow-none transition-all dark:border-neutral-800 dark:bg-neutral-950\">\n        <div className=\"flex flex-col\">\n          <div className=\"flex items-center justify-between gap-4 border-b border-neutral-50 bg-neutral-50/50 px-4 py-3 dark:border-neutral-800 dark:bg-neutral-950\">\n            <div className=\"flex items-center gap-2.5\">\n              <span className=\"text-sm font-semibold tracking-tight text-neutral-900 dark:text-neutral-100\">\n                Alerts\n              </span>\n              <div className=\"rounded-full border border-orange-500/20 bg-orange-500/10 px-1.5 py-0.5 text-[9px] leading-none font-bold text-orange-600 dark:bg-orange-500/20 dark:text-orange-500\">\n                {\n                  notifications.filter((i) => !readMessages.includes(i.id))\n                    .length\n                }{' '}\n                new\n              </div>\n            </div>\n            <div className=\"flex items-center gap-0.5\">\n              <Button\n                variant=\"ghost\"\n                className=\"size-7 rounded-lg p-0 text-neutral-400 transition-colors hover:bg-neutral-100 hover:text-emerald-500 dark:hover:bg-neutral-800\"\n                onClick={() =>\n                  setReadMessages(notifications.map((item) => item.id))\n                }\n                title=\"Mark all as read\"\n              >\n                <CheckCheckIcon className=\"size-3.5\" />\n              </Button>\n              <Button\n                variant=\"ghost\"\n                className=\"size-7 rounded-lg p-0 text-neutral-400 transition-colors hover:bg-neutral-100 dark:hover:bg-neutral-800\"\n                title=\"Settings\"\n              >\n                <Settings2Icon className=\"size-3.5\" />\n              </Button>\n            </div>\n          </div>\n\n          <ul className=\"flex flex-col gap-1.5 p-2\">\n            {notifications.map((item) => (\n              <li\n                key={item.id}\n                className={cn(\n                  'group relative flex cursor-pointer items-start gap-3 rounded-2xl border px-3 py-2.5 transition-all',\n                  !readMessages.includes(item.id)\n                    ? 'border-neutral-100 bg-neutral-50/50 dark:border-neutral-800 dark:bg-white/5'\n                    : 'border-transparent bg-transparent hover:border-neutral-100 hover:bg-neutral-50 dark:hover:border-neutral-800 dark:hover:bg-white/5',\n                )}\n                onClick={() => setReadMessages([...readMessages, item.id])}\n              >\n                <div\n                  className={cn(\n                    'flex size-8 shrink-0 items-center justify-center rounded-xl border border-transparent transition-all group-hover:scale-105',\n                    item.color,\n                  )}\n                >\n                  <item.icon className=\"size-4\" />\n                </div>\n                <div className=\"flex min-w-0 flex-1 flex-col gap-0\">\n                  <div className=\"line-clamp-2 text-[12px] leading-tight font-semibold tracking-tight text-neutral-900 dark:text-neutral-100\">\n                    {item.message}\n                  </div>\n                  <div className=\"mt-0.5 flex items-center justify-between gap-2\">\n                    <p className=\"text-[9px] font-medium text-neutral-500\">\n                      {item.category}\n                    </p>\n                    <div className=\"flex items-center gap-1.5 opacity-60\">\n                      <ClockIcon className=\"size-2.5 text-neutral-400\" />\n                      <p className=\"text-[9px] font-normal tracking-tight whitespace-nowrap text-neutral-500\">\n                        {item.time} ago\n                      </p>\n                    </div>\n                  </div>\n                </div>\n              </li>\n            ))}\n          </ul>\n\n          <div className=\"border-t border-neutral-100 p-3 dark:border-neutral-800\">\n            <Button\n              variant=\"outline\"\n              className=\"w-full rounded-xl border-neutral-200 bg-white text-[11px] font-semibold text-neutral-500 shadow-none transition-all hover:text-orange-500 active:scale-95 dark:border-neutral-800 dark:bg-neutral-950\"\n            >\n              View all alerts\n            </Button>\n          </div>\n        </div>\n      </PopoverContent>\n    </Popover>\n  );\n};\n\nexport default Popover11;\n"
    }
  ]
}
