import { Tab } from "@headlessui/react"; import { AccountSettings } from "@/types/global"; import { useState } from "react"; import ChangePassword from "./ChangePassword"; import ProfileSettings from "./ProfileSettings"; import PrivacySettings from "./PrivacySettings"; import BillingPortal from "./BillingPortal"; type Props = { toggleSettingsModal: Function; activeUser: AccountSettings; className?: string; defaultIndex?: number; }; const STRIPE_BILLING_PORTAL_URL = process.env.NEXT_PUBLIC_STRIPE_BILLING_PORTAL_URL; export default function UserModal({ className, defaultIndex, toggleSettingsModal, activeUser, }: Props) { const [user, setUser] = useState(activeUser); return (
selected ? "px-2 py-1 bg-sky-200 dark:bg-sky-800 dark:text-white duration-100 rounded-md outline-none" : "px-2 py-1 hover:bg-slate-200 hover:dark:bg-neutral-700 rounded-md duration-100 outline-none" } > Profile Settings selected ? "px-2 py-1 bg-sky-200 dark:bg-sky-800 dark:text-white duration-100 rounded-md outline-none" : "px-2 py-1 hover:bg-slate-200 hover:dark:bg-neutral-700 rounded-md duration-100 outline-none" } > Privacy Settings selected ? "px-2 py-1 bg-sky-200 dark:bg-sky-800 dark:text-white duration-100 rounded-md outline-none" : "px-2 py-1 hover:bg-slate-200 hover:dark:bg-neutral-700 rounded-md duration-100 outline-none" } > Password {STRIPE_BILLING_PORTAL_URL ? ( selected ? "px-2 py-1 bg-sky-200 dark:bg-sky-800 duration-100 rounded-md outline-none" : "px-2 py-1 hover:bg-slate-200 hover:dark:bg-neutral-700 rounded-md duration-100 outline-none" } > Billing ) : undefined} {STRIPE_BILLING_PORTAL_URL ? ( ) : undefined}
); }