{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "comp-383",
  "type": "registry:component",
  "title": "Comp 383",
  "description": "Comp 383",
  "files": [
    {
      "path": "registry/ui-basic/comp-383.tsx",
      "content": "\"use client\";\r\n\r\nimport { useState } from \"react\";\r\n\r\nimport { Badge } from \"@/components/ui/badge\";\r\nimport { Button } from \"@/components/ui/button\";\r\nimport {\r\n\tPopover,\r\n\tPopoverContent,\r\n\tPopoverTrigger,\r\n} from \"@/components/ui/popover\";\r\nimport { BellIcon } from \"lucide-react\";\r\n\r\nconst initialNotifications = [\r\n\t{\r\n\t\tid: 1,\r\n\t\timage: \"/avatar-80-01.jpg\",\r\n\t\tuser: \"Chris Tompson\",\r\n\t\taction: \"requested review on\",\r\n\t\ttarget: \"PR #42: Feature implementation\",\r\n\t\ttimestamp: \"15 minutes ago\",\r\n\t\tunread: true,\r\n\t},\r\n\t{\r\n\t\tid: 2,\r\n\t\timage: \"/avatar-80-02.jpg\",\r\n\t\tuser: \"Emma Davis\",\r\n\t\taction: \"shared\",\r\n\t\ttarget: \"New component library\",\r\n\t\ttimestamp: \"45 minutes ago\",\r\n\t\tunread: true,\r\n\t},\r\n\t{\r\n\t\tid: 3,\r\n\t\timage: \"/avatar-80-03.jpg\",\r\n\t\tuser: \"James Wilson\",\r\n\t\taction: \"assigned you to\",\r\n\t\ttarget: \"API integration task\",\r\n\t\ttimestamp: \"4 hours ago\",\r\n\t\tunread: false,\r\n\t},\r\n\t{\r\n\t\tid: 4,\r\n\t\timage: \"/avatar-80-04.jpg\",\r\n\t\tuser: \"Alex Morgan\",\r\n\t\taction: \"replied to your comment in\",\r\n\t\ttarget: \"Authentication flow\",\r\n\t\ttimestamp: \"12 hours ago\",\r\n\t\tunread: false,\r\n\t},\r\n\t{\r\n\t\tid: 5,\r\n\t\timage: \"/avatar-80-05.jpg\",\r\n\t\tuser: \"Sarah Chen\",\r\n\t\taction: \"commented on\",\r\n\t\ttarget: \"Dashboard redesign\",\r\n\t\ttimestamp: \"2 days ago\",\r\n\t\tunread: false,\r\n\t},\r\n\t{\r\n\t\tid: 6,\r\n\t\timage: \"/avatar-80-06.jpg\",\r\n\t\tuser: \"Miky Derya\",\r\n\t\taction: \"mentioned you in\",\r\n\t\ttarget: \"Origin UI open graph image\",\r\n\t\ttimestamp: \"2 weeks ago\",\r\n\t\tunread: false,\r\n\t},\r\n];\r\n\r\nfunction Dot({ className }: { className?: string }) {\r\n\treturn (\r\n\t\t<svg\r\n\t\t\twidth=\"6\"\r\n\t\t\theight=\"6\"\r\n\t\t\tfill=\"currentColor\"\r\n\t\t\tviewBox=\"0 0 6 6\"\r\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\r\n\t\t\tclassName={className}\r\n\t\t\taria-hidden=\"true\"\r\n\t\t>\r\n\t\t\t<circle cx=\"3\" cy=\"3\" r=\"3\" />\r\n\t\t</svg>\r\n\t);\r\n}\r\n\r\nexport default function Component() {\r\n\tconst [notifications, setNotifications] = useState(initialNotifications);\r\n\tconst unreadCount = notifications.filter((n) => n.unread).length;\r\n\r\n\tconst handleMarkAllAsRead = () => {\r\n\t\tsetNotifications(\r\n\t\t\tnotifications.map((notification) => ({\r\n\t\t\t\t...notification,\r\n\t\t\t\tunread: false,\r\n\t\t\t}))\r\n\t\t);\r\n\t};\r\n\r\n\tconst handleNotificationClick = (id: number) => {\r\n\t\tsetNotifications(\r\n\t\t\tnotifications.map((notification) =>\r\n\t\t\t\tnotification.id === id\r\n\t\t\t\t\t? { ...notification, unread: false }\r\n\t\t\t\t\t: notification\r\n\t\t\t)\r\n\t\t);\r\n\t};\r\n\r\n\treturn (\r\n\t\t<Popover>\r\n\t\t\t<PopoverTrigger asChild>\r\n\t\t\t\t<Button\r\n\t\t\t\t\tsize=\"icon\"\r\n\t\t\t\t\tvariant=\"outline\"\r\n\t\t\t\t\tclassName=\"relative\"\r\n\t\t\t\t\taria-label=\"Open notifications\"\r\n\t\t\t\t>\r\n\t\t\t\t\t<BellIcon size={16} aria-hidden=\"true\" />\r\n\t\t\t\t\t{unreadCount > 0 && (\r\n\t\t\t\t\t\t<Badge className=\"absolute -top-2 left-full min-w-5 -translate-x-1/2 px-1\">\r\n\t\t\t\t\t\t\t{unreadCount > 99 ? \"99+\" : unreadCount}\r\n\t\t\t\t\t\t</Badge>\r\n\t\t\t\t\t)}\r\n\t\t\t\t</Button>\r\n\t\t\t</PopoverTrigger>\r\n\t\t\t<PopoverContent className=\"w-80 p-1\">\r\n\t\t\t\t<div className=\"flex items-baseline justify-between gap-4 px-3 py-2\">\r\n\t\t\t\t\t<div className=\"text-sm font-semibold\">Notifications</div>\r\n\t\t\t\t\t{unreadCount > 0 && (\r\n\t\t\t\t\t\t<button\r\n\t\t\t\t\t\t\tclassName=\"text-xs font-medium hover:underline\"\r\n\t\t\t\t\t\t\tonClick={handleMarkAllAsRead}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\tMark all as read\r\n\t\t\t\t\t\t</button>\r\n\t\t\t\t\t)}\r\n\t\t\t\t</div>\r\n\t\t\t\t<div\r\n\t\t\t\t\trole=\"separator\"\r\n\t\t\t\t\taria-orientation=\"horizontal\"\r\n\t\t\t\t\tclassName=\"bg-border -mx-1 my-1 h-px\"\r\n\t\t\t\t></div>\r\n\t\t\t\t{notifications.map((notification) => (\r\n\t\t\t\t\t<div\r\n\t\t\t\t\t\tkey={notification.id}\r\n\t\t\t\t\t\tclassName=\"hover:bg-accent rounded-md px-3 py-2 text-sm transition-colors\"\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t<div className=\"relative flex items-start gap-3 pe-3\">\r\n\t\t\t\t\t\t\t<img\r\n\t\t\t\t\t\t\t\tclassName=\"size-9 rounded-md\"\r\n\t\t\t\t\t\t\t\tsrc={notification.image}\r\n\t\t\t\t\t\t\t\twidth={32}\r\n\t\t\t\t\t\t\t\theight={32}\r\n\t\t\t\t\t\t\t\talt={notification.user}\r\n\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t<div className=\"flex-1 space-y-1\">\r\n\t\t\t\t\t\t\t\t<button\r\n\t\t\t\t\t\t\t\t\tclassName=\"text-foreground/80 text-left after:absolute after:inset-0\"\r\n\t\t\t\t\t\t\t\t\tonClick={() =>\r\n\t\t\t\t\t\t\t\t\t\thandleNotificationClick(notification.id)\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t<span className=\"text-foreground font-medium hover:underline\">\r\n\t\t\t\t\t\t\t\t\t\t{notification.user}\r\n\t\t\t\t\t\t\t\t\t</span>{\" \"}\r\n\t\t\t\t\t\t\t\t\t{notification.action}{\" \"}\r\n\t\t\t\t\t\t\t\t\t<span className=\"text-foreground font-medium hover:underline\">\r\n\t\t\t\t\t\t\t\t\t\t{notification.target}\r\n\t\t\t\t\t\t\t\t\t</span>\r\n\t\t\t\t\t\t\t\t\t.\r\n\t\t\t\t\t\t\t\t</button>\r\n\t\t\t\t\t\t\t\t<div className=\"text-muted-foreground text-xs\">\r\n\t\t\t\t\t\t\t\t\t{notification.timestamp}\r\n\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t{notification.unread && (\r\n\t\t\t\t\t\t\t\t<div className=\"absolute inset-e-0 self-center\">\r\n\t\t\t\t\t\t\t\t\t<Dot />\r\n\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t))}\r\n\t\t\t</PopoverContent>\r\n\t\t</Popover>\r\n\t);\r\n}\r\n",
      "type": "registry:ui"
    },
    {
      "path": "components/ui/badge.tsx",
      "content": "import React from \"react\";\r\n\r\nimport { cn } from \"@/registry/utilities/cn\";\r\nimport { cva, type VariantProps } from \"class-variance-authority\";\r\n\r\nconst badgeVariants = cva(\r\n\t\"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2\",\r\n\t{\r\n\t\tvariants: {\r\n\t\t\tvariant: {\r\n\t\t\t\tdefault:\r\n\t\t\t\t\t\"border-transparent bg-primary text-primary-foreground hover:bg-primary/80\",\r\n\t\t\t\tsecondary:\r\n\t\t\t\t\t\"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80\",\r\n\t\t\t\tdestructive:\r\n\t\t\t\t\t\"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80\",\r\n\t\t\t\toutline: \"text-foreground\",\r\n\t\t\t},\r\n\t\t},\r\n\t\tdefaultVariants: {\r\n\t\t\tvariant: \"default\",\r\n\t\t},\r\n\t}\r\n);\r\n\r\nexport interface BadgeProps\r\n\textends React.HTMLAttributes<HTMLDivElement>,\r\n\t\tVariantProps<typeof badgeVariants> {}\r\n\r\nfunction Badge({ className, variant, ...props }: BadgeProps) {\r\n\treturn (\r\n\t\t<div className={cn(badgeVariants({ variant }), className)} {...props} />\r\n\t);\r\n}\r\n\r\nexport { Badge, badgeVariants };\r\n",
      "type": "registry:ui"
    },
    {
      "path": "registry/utilities/cn.ts",
      "content": "import { ClassValue, clsx } from \"clsx\";\r\nimport { twMerge } from \"tailwind-merge\";\r\n\r\nexport function cn(...inputs: ClassValue[]) {\r\n\treturn twMerge(clsx(inputs));\r\n}\r\n",
      "type": "registry:ui"
    },
    {
      "path": "components/ui/button.tsx",
      "content": "import * as React from \"react\";\r\n\r\nimport { cn } from \"@/registry/utilities/cn\";\r\nimport { Slot } from \"@radix-ui/react-slot\";\r\nimport { cva, type VariantProps } from \"class-variance-authority\";\r\n\r\nconst buttonVariants = cva(\r\n\t\"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm text-white hover:text-gray-400 font-medium ring-offset-background transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50\",\r\n\t{\r\n\t\tvariants: {\r\n\t\t\tvariant: {\r\n\t\t\t\tsimple:\r\n\t\t\t\t\t\"bg-secondary relative z-10 bg-transparent hover:border-secondary hover:bg-secondary/50  border border-transparent dark:text-white text-sm md:text-sm transition font-medium duration-200  rounded-md px-4 py-2  flex items-center justify-center\",\r\n\t\t\t\tdefault: \"bg-primary text-primary-foreground hover:bg-primary/90\",\r\n\t\t\t\tdestructive:\r\n\t\t\t\t\t\"bg-destructive text-destructive-foreground hover:bg-destructive/90\",\r\n\t\t\t\toutline:\r\n\t\t\t\t\t\"border border-input bg-background hover:bg-accent hover:text-accent-foreground\",\r\n\t\t\t\tsecondary:\r\n\t\t\t\t\t\"bg-secondary text-secondary-foreground hover:bg-secondary/80\",\r\n\t\t\t\tghost: \"hover:bg-accent hover:text-black hover:stroke-black dark:text-white text-black\",\r\n\t\t\t\tlink: \"text-primary underline-offset-4 hover:underline\",\r\n\t\t\t},\r\n\t\t\tsize: {\r\n\t\t\t\tdefault: \"h-10 px-4 py-2\",\r\n\t\t\t\tsm: \"h-9 rounded-md px-3\",\r\n\t\t\t\tlg: \"h-11 rounded-md px-8\",\r\n\t\t\t\ticon: \"h-10 w-10\",\r\n\t\t\t},\r\n\t\t},\r\n\t\tdefaultVariants: {\r\n\t\t\tvariant: \"default\",\r\n\t\t\tsize: \"default\",\r\n\t\t},\r\n\t}\r\n);\r\n\r\nexport interface ButtonProps\r\n\textends React.ButtonHTMLAttributes<HTMLButtonElement>,\r\n\t\tVariantProps<typeof buttonVariants> {\r\n\tasChild?: boolean;\r\n}\r\n\r\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\r\n\t({ className, variant, size, asChild = false, ...props }, ref) => {\r\n\t\tconst Comp = asChild ? Slot : \"button\";\r\n\t\treturn (\r\n\t\t\t<Comp\r\n\t\t\t\tclassName={cn(buttonVariants({ variant, size, className }))}\r\n\t\t\t\tref={ref}\r\n\t\t\t\t{...props}\r\n\t\t\t/>\r\n\t\t);\r\n\t}\r\n);\r\nButton.displayName = \"Button\";\r\n\r\nexport { Button, buttonVariants };\r\n",
      "type": "registry:ui"
    }
  ]
}