import { jsx as _jsx } from "react/jsx-runtime";
import { useEditContext } from "../client/editContext";
export function User({ session }) {
    const editContext = useEditContext();
    if (!editContext)
        return;
    const userName = session.user.fullName || session.user.name;
    const idxBackslash = userName.indexOf("\\");
    const letter = idxBackslash >= 0
        ? userName[idxBackslash + 1]
        : userName[0]
            ? userName[0].toUpperCase()
            : "";
    const userEmail = session.user.email?.trim();
    const userTitle = userEmail ? `${userName} (${userEmail})` : userName;
    return (_jsx("div", { className: "grid h-7 w-7 items-center justify-center rounded-full text-xs font-normal text-white", style: { background: session.color }, title: userTitle, children: letter?.toUpperCase() }));
}
//# sourceMappingURL=User.js.map