aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/components/ConfirmDialog.tsx
blob: 925118d3c211352f076772bb404522773dc158fd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import React from 'react';

import '@css/Dialog.css';

interface ConfirmDialogProps {
  title: string;
  subtitle: string;
  onConfirm: () => void;
  onCancel: () => void;
}

const ConfirmDialog: React.FC<ConfirmDialogProps> = ({
  title,
  subtitle,
  onConfirm,
  onCancel,
}) => {
  return (
    <div className="dimmer">
      <div className="dialog">
        <div className="dialog-element dialog-header">
          <span>{title}</span>
        </div>
        <div className="dialog-element dialog-description">
          <span>{subtitle}</span>
        </div>
        <div className="dialog-element dialog-btns-container">
          <button onClick={onCancel}>Cancel</button>
          <button onClick={onConfirm}>Confirm</button>
        </div>
      </div>
    </div>
  );
};

export default ConfirmDialog;