"use client"; import { useState } from "react"; import { Button } from "@/components/ui/button"; import { Label } from "@/components/ui/label"; import { Logo } from "@/components/Logo"; import { US_STATES, setUserState, requiresIdVerification } from "@/lib/id-verification"; import { AudiencePicker } from "@/components/AudiencePicker"; import { saveAudienceView, formatSiteTitle, type AudienceViewMode } from "@/lib/audience"; interface AgeGateProps { onVerified: () => void; } export function AgeGate({ onVerified }: AgeGateProps) { const [month, setMonth] = useState(""); const [day, setDay] = useState(""); const [year, setYear] = useState(""); const [state, setState] = useState(""); const [error, setError] = useState(""); const [agreed, setAgreed] = useState(false); const [audienceView, setAudienceView] = useState("gay-men"); const handleVerify = () => { const m = parseInt(month, 10); const d = parseInt(day, 10); const y = parseInt(year, 10); if (!m || !d || !y) { setError("Please enter your full date of birth."); return; } if (!state) { setError("Please select your state — required for content access rules."); return; } const dob = new Date(y, m - 1, d); const today = new Date(); let age = today.getFullYear() - dob.getFullYear(); const monthDiff = today.getMonth() - dob.getMonth(); if (monthDiff < 0 || (monthDiff === 0 && today.getDate() < dob.getDate())) { age--; } if (age < 18) { setError("You must be 18 or older to access this site."); return; } if (!agreed) { setError("You must confirm you are 18+ and agree to the disclaimer."); return; } saveAudienceView(audienceView); localStorage.setItem("eg_age_verified", "true"); localStorage.setItem("eg_age_verified_at", new Date().toISOString()); setUserState(state); if (requiresIdVerification(state)) { localStorage.setItem("eg_id_verification_required", "true"); } else { localStorage.removeItem("eg_id_verification_required"); } onVerified(); }; const idRequired = requiresIdVerification(state); return (

{formatSiteTitle(audienceView)}

Adults only. Explicit content ahead.

{idRequired && (

{US_STATES.find((s) => s.code === state)?.name} requires ID verification for nude photos — not required to browse as a guest.

)}

No account needed. Verify your age with date of birth only — browse the map, spots, and profiles free. Explicit photos and chat require a free signup. Government ID is only needed for nude content in certain states.

{error && (

{error}

)}

100% free forever. No subscriptions. No credit card required.

); }