/*
* Copyright (C) 2026 Fluxer Contributors
*
* This file is part of Fluxer.
*
* Fluxer is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Fluxer is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Fluxer. If not, see .
*/
import {Trans, useLingui} from '@lingui/react/macro';
import {observer} from 'mobx-react-lite';
import * as ModalActionCreators from '~/actions/ModalActionCreators';
import * as Modal from '~/components/modals/Modal';
import {GuildIcon} from '~/components/popouts/GuildIcon';
import {Button} from '~/components/uikit/Button/Button';
import type {GuildRecord} from '~/records/GuildRecord';
import styles from './GuildOwnershipWarningModal.module.css';
interface GuildOwnershipWarningModalProps {
ownedGuilds: Array;
action: 'disable' | 'delete';
}
export const GuildOwnershipWarningModal: React.FC = observer(
({ownedGuilds, action}) => {
const {t} = useLingui();
const displayedGuilds = ownedGuilds.slice(0, 3);
const remainingCount = ownedGuilds.length - 3;
return (
{action === 'disable' ? (
You cannot disable your account while you own communities. Please transfer ownership of the following
communities first:
) : (
You cannot delete your account while you own communities. Please transfer ownership of the following
communities first:
)}
{displayedGuilds.map((guild) => (
{guild.name}
))}
{remainingCount > 0 && (
and {remainingCount} more
)}
To transfer ownership, go to Community Settings → Overview and use the Transfer Ownership option.