{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "ds-notification-center",
  "title": "Notification Center",
  "description": "A notification center component.",
  "dependencies": [
    "lucide-react"
  ],
  "registryDependencies": [
    "@lema-ds/popover",
    "@lema-ds/button",
    "@lema-ds/ui-i18n",
    "@lema-ds/ds-locale-provider"
  ],
  "files": [
    {
      "path": "components/ds/ds-notification-center.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { BellIcon, CheckIcon } from \"lucide-react\"\n\nimport { Button } from \"@/components/ui/button\"\nimport {\n  Popover,\n  PopoverContent,\n  PopoverTrigger,\n} from \"@/components/ui/popover\"\nimport { cn } from \"@/lib/utils\"\n\nimport { UI_I18N, type UILocale } from \"@/lib/ui-i18n\"\nimport { useUILocale } from \"@/components/ui/ds-locale-provider\"\n\n// ── Types ──\n\nexport interface NotificationItem {\n  id: string\n  title: string\n  description?: string\n  date: Date\n  unread: boolean\n  onClick?: () => void\n}\n\nexport interface NotificationCenterProps {\n  notifications: NotificationItem[]\n  onMarkAllAsRead?: () => void\n  emptyText?: string\n  title?: string\n  locale?: UILocale\n  className?: string\n}\n\n// ── Component ──\n\nexport function NotificationCenter({\n  notifications,\n  onMarkAllAsRead,\n  emptyText,\n  title,\n  locale: localeProp,\n  className,\n}: NotificationCenterProps) {\n  const locale = useUILocale(localeProp)\n  const i18n = UI_I18N[locale].notificationCenter\n  const displayTitle = title ?? i18n.title\n  const displayEmptyText = emptyText ?? i18n.empty\n  const unreadCount = notifications.filter((n) => n.unread).length\n\n  return (\n    <Popover>\n      <PopoverTrigger asChild>\n        <Button\n          variant=\"outline\"\n          size=\"icon\"\n          className={cn(\"relative\", className)}\n          aria-label={displayTitle}\n        >\n          <BellIcon className=\"size-4\" />\n          {unreadCount > 0 && (\n            <span className=\"absolute top-1.5 right-1.5 flex size-2 items-center justify-center rounded-full bg-destructive\">\n              <span className=\"sr-only\">{unreadCount}</span>\n            </span>\n          )}\n        </Button>\n      </PopoverTrigger>\n      <PopoverContent\n        className=\"w-80 p-0\"\n        align=\"end\"\n        data-slot=\"ds-notification-center\"\n      >\n        <div className=\"flex items-center justify-between border-b px-4 py-3\">\n          <p className=\"text-sm font-semibold\">{displayTitle}</p>\n          {unreadCount > 0 && onMarkAllAsRead && (\n            <Button\n              variant=\"ghost\"\n              size=\"sm\"\n              className=\"h-auto p-0 text-xs text-muted-foreground hover:text-foreground\"\n              onClick={onMarkAllAsRead}\n            >\n              <CheckIcon className=\"mr-1 size-3\" />\n              {i18n.markAllAsRead}\n            </Button>\n          )}\n        </div>\n        <div className=\"flex max-h-96 flex-col overflow-y-auto p-2\">\n          {notifications.length === 0 ? (\n            <p className=\"p-4 text-center text-sm text-muted-foreground\">\n              {displayEmptyText}\n            </p>\n          ) : (\n            notifications.map((notification) => (\n              <div\n                key={notification.id}\n                role=\"button\"\n                tabIndex={0}\n                onClick={notification.onClick}\n                className={cn(\n                  \"flex cursor-pointer flex-col gap-1 rounded-md p-3 text-sm transition-colors hover:bg-muted\",\n                  notification.unread && \"bg-muted/50\"\n                )}\n                onKeyDown={(e) => {\n                  if (e.key === \"Enter\" || e.key === \" \") {\n                    e.preventDefault()\n                    notification.onClick?.()\n                  }\n                }}\n              >\n                <div className=\"flex items-center justify-between gap-2\">\n                  <span\n                    className={cn(\n                      \"leading-none font-medium text-foreground\",\n                      notification.unread && \"font-semibold\"\n                    )}\n                  >\n                    {notification.title}\n                  </span>\n                  {notification.unread && (\n                    <span className=\"size-1.5 shrink-0 rounded-full bg-primary\" />\n                  )}\n                </div>\n                {notification.description && (\n                  <p className=\"line-clamp-2 text-xs text-muted-foreground\">\n                    {notification.description}\n                  </p>\n                )}\n                <span className=\"mt-1 text-xs text-muted-foreground\">\n                  {notification.date.toLocaleDateString(undefined, {\n                    hour: \"2-digit\",\n                    minute: \"2-digit\",\n                  })}\n                </span>\n              </div>\n            ))\n          )}\n        </div>\n      </PopoverContent>\n    </Popover>\n  )\n}\n",
      "type": "registry:ui"
    }
  ],
  "type": "registry:ui"
}
