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

32 lines
1 KiB
JavaScript

// src/components-page/account-settings/teams/team-display-name-section.tsx
import { useUser } from "../../../lib/hooks";
import { useTranslation } from "../../../lib/translations";
import { EditableText } from "../editable-text";
import { Section } from "../section";
import { jsx } from "react/jsx-runtime";
function TeamDisplayNameSection(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 display name"),
description: t("Change the display name of your team"),
children: /* @__PURE__ */ jsx(
EditableText,
{
value: props.team.displayName,
onSave: async (newDisplayName) => await props.team.update({ displayName: newDisplayName })
}
)
}
);
}
export {
TeamDisplayNameSection
};
//# sourceMappingURL=team-display-name-section.js.map