'use client';
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { useId } from 'react';
import { SecurityCard } from './settings/securityPrimitives.js';
import { AccountSecurity } from './profile/AccountSecurity.js';
function roleLabel(role) {
    if (!role)
        return 'Member';
    return role.charAt(0).toUpperCase() + role.slice(1).toLowerCase();
}
export function Profile({ session } = {}) {
    const accountHeadingId = useId();
    const user = session?.user;
    return (_jsxs("div", { className: "p-3 pr-6 sm:p-4 sm:pr-8", children: [_jsxs("div", { className: "mb-4", children: [_jsx("h1", { className: "text-foreground mb-1 text-2xl font-medium", children: "Your profile" }), _jsx("p", { className: "text-muted-foreground text-sm", children: "Manage your account details and sign-in security." })] }), _jsxs("div", { className: "grid max-w-3xl gap-4", children: [_jsx(SecurityCard, { headingId: accountHeadingId, title: "Account", description: "Your identity within this CMS. Contact an administrator to change your role.", children: _jsxs("dl", { className: "divide-border divide-y text-sm", children: [_jsxs("div", { className: "flex items-center justify-between gap-3 py-2", children: [_jsx("dt", { className: "text-muted-foreground", children: "Name" }), _jsx("dd", { className: "text-foreground", children: user?.name ?? '—' })] }), _jsxs("div", { className: "flex items-center justify-between gap-3 py-2", children: [_jsx("dt", { className: "text-muted-foreground", children: "Email" }), _jsx("dd", { className: "text-foreground", children: user?.email ?? '—' })] }), _jsxs("div", { className: "flex items-center justify-between gap-3 py-2", children: [_jsx("dt", { className: "text-muted-foreground", children: "Role" }), _jsx("dd", { className: "text-foreground", children: roleLabel(user?.role) })] })] }) }), _jsx(AccountSecurity, {})] })] }));
}
//# sourceMappingURL=Profile.js.map