import Link from "next/link"; import { BadgeCheck, MailWarning } from "lucide-react"; import { getWorkspace } from "@/lib/session"; import { formatDate, titleCase } from "@/lib/format"; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"; import { Badge } from "@/components/ui/badge"; import { Alert } from "@/components/ui/alert"; import { ThemeToggle } from "@/components/ui/theme"; import { ResendVerificationButton } from "@/components/dashboard/resend-verification"; import { ProfileNameForm } from "@/components/dashboard/settings/profile-form"; import { ChangeEmailDialog } from "@/components/dashboard/settings/change-email-dialog"; import { OrganizationForm } from "@/components/dashboard/settings/organization-form"; import { DeleteAccountDialog } from "@/components/dashboard/settings/delete-account-dialog"; export const dynamic = "force-dynamic"; export default async function SettingsProfilePage({ searchParams }: { searchParams: Promise<{ "email-changed"?: string }> }) { const sp = await searchParams; const ws = await getWorkspace(); const canEditOrg = ["owner", "admin", "billing"].includes(ws.role); return (
{sp["email-changed"] === "1" ? Your new address is now your login. If it is not verified yet, use the button below. : null} Profile How you appear across Fetcha. Member since {formatDate(ws.user.createdAt, { timeStyle: undefined })}.
Email
{ws.user.email} {ws.user.emailVerified ? ( Verified ) : ( Unverified )}
{!ws.user.emailVerified ? : null}

{ws.user.emailVerified ? "Security notices and receipts go to this address." : "Verify your address to unlock production API access."}

Organization
{titleCase(ws.role)} {titleCase(ws.organization.plan)} plan
Organization-wide spending limits apply on top of per-project limits. Manage your plan in{" "} Billing . Teams and invitations are not available yet.
Appearance Theme preference is stored in this browser.

Light, dark, or follow your system.

Danger zone Deleting your account removes your organization, projects, keys and request history. Requires your password and an email confirmation.
); }