eigent/package/@stackframe/react/dist/esm/components-page/account-settings/teams/team-profile-image-section.js

34 lines
1.1 KiB
JavaScript

// src/components-page/account-settings/teams/team-profile-image-section.tsx
import { ProfileImageEditor } from "../../../components/profile-image-editor";
import { useUser } from "../../../lib/hooks";
import { useTranslation } from "../../../lib/translations";
import { Section } from "../section";
import { jsx } from "react/jsx-runtime";
function TeamProfileImageSection(props) {
const { t } = useTranslation();
const user = useUser({ or: "redirect" });
const updateTeamPermission = user.usePermission(props.team, "$update_team");
if (!updateTeamPermission) {
return null;
}
return /* @__PURE__ */ jsx(
Section,
{
title: t("Team profile image"),
description: t("Upload an image for your team"),
children: /* @__PURE__ */ jsx(
ProfileImageEditor,
{
user: props.team,
onProfileImageUrlChange: async (profileImageUrl) => {
await props.team.update({ profileImageUrl });
}
}
)
}
);
}
export {
TeamProfileImageSection
};
//# sourceMappingURL=team-profile-image-section.js.map