Files
discord-decomp/modules/voice_panel/native/alerts/VoicePanelMaxCapacityAlert.tsx
T
2026-11-01 12:12:55 +02:00

23 lines
1.2 KiB
TypeScript

// Metro module 16011 (f16012).
import ChannelStore from "../../../../stores/ChannelStore";
import { useStateFromStores } from "../../../../_bundle/defaultAreStatesEqual";
import { useDismissModalCallback, AlertActionButton } from "../../../../design/components/AlertModal/native/AlertModal.native";
import { AlertModal } from "../../../../design/components/AlertModal/native/AlertModal.native";
import VoicePanelLockedIcon from "./VoicePanelLockedIcon";
import { intl, t } from "../../../../intl/index.native";
export default function VoicePanelMaxCapacityAlert(props) {
const channelId = props.channelId;
const stateFromStores = useStateFromStores([ChannelStore], () => {
let r9 = ChannelStore.getChannel(channelId)?.userLimit;
if (r9 == null) {
r9 = 0;
}
return r9;
}, [channelId]);
const dismissModalCallback = useDismissModalCallback();
return <AlertModal header={<VoicePanelLockedIcon />} title={intl.string(t.hHbsQj)} content={intl.formatToPlainString(t["387SQH"], {
count: stateFromStores
})} actions={<AlertActionButton variant="secondary" text={intl.string(t["NX+WJN"])} onPress={dismissModalCallback} />} />;
};
export const VOICE_PANEL_MAX_CAPACITY_KEY = "voice-panel-max-capacity";