{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "alert-dialog7",
  "title": "Alert dialog",
  "description": "Alert dialog built with shadcn/ui.",
  "files": [
    {
      "path": "contents/components/alert-dialog/7/index.tsx",
      "content": "\"use client\";\n\nimport { useRef, useState } from \"react\";\n\nimport { Button } from \"@/components/ui/button\";\nimport {\n  Dialog,\n  DialogClose,\n  DialogContent,\n  DialogDescription,\n  DialogFooter,\n  DialogHeader,\n  DialogTitle,\n  DialogTrigger\n} from \"@/components/ui/dialog\";\n\nexport default function Component() {\n  const [hasReadToBottom, setHasReadToBottom] = useState(false);\n  const contentRef = useRef<HTMLDivElement>(null);\n\n  const handleScroll = () => {\n    const content = contentRef.current;\n    if (!content) return;\n\n    const scrollPercentage = content.scrollTop / (content.scrollHeight - content.clientHeight);\n    if (scrollPercentage >= 0.99 && !hasReadToBottom) {\n      setHasReadToBottom(true);\n    }\n  };\n\n  return (\n    <Dialog>\n      <DialogTrigger asChild>\n        <Button variant=\"outline\">Terms & Conditions</Button>\n      </DialogTrigger>\n      <DialogContent className=\"flex flex-col gap-0 p-0 sm:max-h-[min(640px,80vh)] sm:max-w-lg [&>button:last-child]:top-3.5\">\n        <DialogHeader className=\"contents space-y-0 text-left\">\n          <DialogTitle className=\"border-b px-6 py-4 font-normal\">Terms & Conditions</DialogTitle>\n          <div className=\"overflow-y-auto\" onScroll={handleScroll} ref={contentRef}>\n            <DialogDescription asChild>\n              <div className=\"px-6 py-4\">\n                <div className=\"[&_strong]:text-foreground space-y-4 [&_strong]:font-semibold\">\n                  <div className=\"space-y-4\">\n                    <div className=\"space-y-1\">\n                      <p>\n                        <strong>Acceptance of Terms</strong>\n                      </p>\n                      <p>\n                        By accessing and using this website, users agree to comply with and be bound\n                        by these Terms of Service. Users who do not agree with these terms should\n                        discontinue use of the website immediately.\n                      </p>\n                    </div>\n\n                    <div className=\"space-y-1\">\n                      <p>\n                        <strong>User Account Responsibilities</strong>\n                      </p>\n                      <p>\n                        Users are responsible for maintaining the confidentiality of their account\n                        credentials. Any activities occurring under a user&lsquo;s account are the\n                        sole responsibility of the account holder. Users must notify the website\n                        administrators immediately of any unauthorized account access.\n                      </p>\n                    </div>\n\n                    <div className=\"space-y-1\">\n                      <p>\n                        <strong>Content Usage and Restrictions</strong>\n                      </p>\n                      <p>\n                        The website and its original content are protected by intellectual property\n                        laws. Users may not reproduce, distribute, modify, create derivative works,\n                        or commercially exploit any content without explicit written permission from\n                        the website owners.\n                      </p>\n                    </div>\n\n                    <div className=\"space-y-1\">\n                      <p>\n                        <strong>Limitation of Liability</strong>\n                      </p>\n                      <p>\n                        The website provides content &ldquo;as is&ldquo; without any warranties. The\n                        website owners shall not be liable for direct, indirect, incidental,\n                        consequential, or punitive damages arising from user interactions with the\n                        platform.\n                      </p>\n                    </div>\n\n                    <div className=\"space-y-1\">\n                      <p>\n                        <strong>User Conduct Guidelines</strong>\n                      </p>\n                      <ul className=\"list-disc pl-6\">\n                        <li>Not upload harmful or malicious content</li>\n                        <li>Respect the rights of other users</li>\n                        <li>Avoid activities that could disrupt website functionality</li>\n                        <li>Comply with applicable local and international laws</li>\n                      </ul>\n                    </div>\n\n                    <div className=\"space-y-1\">\n                      <p>\n                        <strong>Modifications to Terms</strong>\n                      </p>\n                      <p>\n                        The website reserves the right to modify these terms at any time. Continued\n                        use of the website after changes constitutes acceptance of the new terms.\n                      </p>\n                    </div>\n\n                    <div className=\"space-y-1\">\n                      <p>\n                        <strong>Termination Clause</strong>\n                      </p>\n                      <p>\n                        The website may terminate or suspend user access without prior notice for\n                        violations of these terms or for any other reason deemed appropriate by the\n                        administration.\n                      </p>\n                    </div>\n\n                    <div className=\"space-y-1\">\n                      <p>\n                        <strong>Governing Law</strong>\n                      </p>\n                      <p>\n                        These terms are governed by the laws of the jurisdiction where the website\n                        is primarily operated, without regard to conflict of law principles.\n                      </p>\n                    </div>\n                  </div>\n                </div>\n              </div>\n            </DialogDescription>\n          </div>\n        </DialogHeader>\n        <DialogFooter className=\"border-t px-6 py-4 sm:items-center\">\n          {!hasReadToBottom && (\n            <span className=\"text-muted-foreground grow text-xs max-sm:text-center\">\n              Read all terms before accepting.\n            </span>\n          )}\n          <DialogClose asChild>\n            <Button type=\"button\" variant=\"outline\">\n              Cancel\n            </Button>\n          </DialogClose>\n          <DialogClose asChild>\n            <Button disabled={!hasReadToBottom} type=\"button\">\n              I agree\n            </Button>\n          </DialogClose>\n        </DialogFooter>\n      </DialogContent>\n    </Dialog>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/alert-dialog7.tsx"
    }
  ],
  "type": "registry:component"
}