import { ActionForm, SubmitButton } from "@/components/forms"; import { Tag } from "@/components/status"; import { TimeAgo } from "@/components/time"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import type { AgeInfo } from "@/lib/api"; import { startAgeCheck } from "./actions"; /** The person's own age check (an ID document, say), which covers all their IMVU accounts. */ export function AgeCard({ age, back }: { age: AgeInfo; back: boolean }) { const ways = age.providers.filter((p) => p.scope === "person"); if (ways.length === 0) return null; const now = Date.now(); const verified = age.checks.find( (c) => c.status === "complete" && c.overEighteen && (!c.expiresAt || new Date(c.expiresAt).getTime() > now), ); const latest = age.checks[0]; const pending = latest?.status === "pending" ? latest : undefined; const vendorOf = (id: string) => age.providers.find((p) => p.id === id)?.vendor ?? id; return ( Age Verification {verified ? (

Age verified with {vendorOf(verified.provider)} . All your IMVU accounts count as adult.

) : ( <> {pending ? (

{back ? "Thanks. Your check is being processed; this page shows the result when it's done." : "Your check isn't finished yet."}

) : latest?.status === "complete" && !latest.overEighteen ? (

Your last check found you're under 18.

) : latest?.status === "failed" || latest?.status === "revoked" ? (

Your last check didn't pass. You can try again.

) : (

Verify your age once to count as adult on all your IMVU accounts, not only those IMVU has age verified.

)} {ways.map((p) => (
{pending?.provider === p.id ? "Continue check" : `Verify with ${p.label}`}

Done by {p.vendor}. T5DE only keeps whether you're over 18, never your ID, photo or birth date.

))} )}
); }