## Context Add delete role action, the backend takes care of most of the operations (can't delete a default role, can't delete the admin role, re-assign existing members to default role...) <img width="592" alt="Screenshot 2025-06-17 at 20 24 21" src="https://github.com/user-attachments/assets/3f01f12c-d8a4-466c-b4c7-9674f597a7a8" /> <img width="567" alt="Screenshot 2025-06-17 at 20 24 24" src="https://github.com/user-attachments/assets/8aceaf6c-3082-4ca6-a4dd-9767fc186923" />
21 lines
711 B
TypeScript
21 lines
711 B
TypeScript
import { settingsDraftRoleFamilyState } from '@/settings/roles/states/settingsDraftRoleFamilyState';
|
|
import { t } from '@lingui/core/macro';
|
|
import { useRecoilValue } from 'recoil';
|
|
|
|
type SettingsRoleSettingsDeleteRoleConfirmationModalSubtitleProps = {
|
|
roleId: string;
|
|
};
|
|
|
|
export const SettingsRoleSettingsDeleteRoleConfirmationModalSubtitle = ({
|
|
roleId,
|
|
}: SettingsRoleSettingsDeleteRoleConfirmationModalSubtitleProps) => {
|
|
const settingsDraftRole = useRecoilValue(
|
|
settingsDraftRoleFamilyState(roleId),
|
|
);
|
|
const roleName = settingsDraftRole.label;
|
|
|
|
return (
|
|
<>{t`Confirm deletion of ${roleName} role? This cannot be undone. All members will be reassigned to the default role.`}</>
|
|
);
|
|
};
|