mirror of
https://github.com/stashapp/stash.git
synced 2025-12-21 15:53:49 +01:00
* Add package manager * Add SettingModal validate * Reverse modal button order * Add plugin package management * Refactor ClearableInput
33 lines
842 B
TypeScript
33 lines
842 B
TypeScript
import React from "react";
|
|
import { Button, Modal } from "react-bootstrap";
|
|
import { FormattedMessage } from "react-intl";
|
|
|
|
export interface IAlertModalProps {
|
|
text: JSX.Element | string;
|
|
show?: boolean;
|
|
confirmButtonText?: string;
|
|
onConfirm: () => void;
|
|
onCancel: () => void;
|
|
}
|
|
|
|
export const AlertModal: React.FC<IAlertModalProps> = ({
|
|
text,
|
|
show,
|
|
confirmButtonText,
|
|
onConfirm,
|
|
onCancel,
|
|
}) => {
|
|
return (
|
|
<Modal show={show}>
|
|
<Modal.Body>{text}</Modal.Body>
|
|
<Modal.Footer>
|
|
<Button variant="danger" onClick={() => onConfirm()}>
|
|
{confirmButtonText ?? <FormattedMessage id="actions.confirm" />}
|
|
</Button>
|
|
<Button variant="secondary" onClick={() => onCancel()}>
|
|
<FormattedMessage id="actions.cancel" />
|
|
</Button>
|
|
</Modal.Footer>
|
|
</Modal>
|
|
);
|
|
};
|