import { Popup } from "@Context/Popups"; import { ReactNode } from "react"; import { Message } from "@Component/Message/Message"; import { Theme } from "@Component/Theme/Theme"; import { AllI18nKeys, Localization } from "@Component/Localization/Localization"; import "./ConfirmPopup.scss"; interface IConfirmPopupProps { titleI18N?: AllI18nKeys; infoI18n: AllI18nKeys; yesI18n?: AllI18nKeys; noI18n?: AllI18nKeys; yes?: () => any; no?: () => any; red?: "yes" | "no"; } class ConfirmPopup extends Popup { public width: number = 300; public height: number = 180; public onRenderHeader(): ReactNode { return } public render(): ReactNode { const yesClassList: string[] = ["action-button", "yes-button"]; const noClassList: string[] = ["action-button", "no-button"]; if (this.props.red === "no") { noClassList.push("red"); } if (this.props.red === "yes") { yesClassList.push("red"); } return
{ this.props.yes ? this.props.yes() : null; this.close(); }}>
{ this.props.no ? this.props.no() : null; this.close(); }}>
; } } export { ConfirmPopup }