export interface DialogButtonsProps {
  buttonLabel: string[];
  onConfirm: () => void;
  onCancel: () => void;
}

export const DialogButtons = ({ buttonLabel, onConfirm, onCancel }: DialogButtonsProps) => {
  if (buttonLabel.length === 1) {
    return (
      <button className="btn-40 btn-darkgray" onClick={onConfirm}>
        {buttonLabel[0]}
      </button>
    );
  }
  return (
    <div className="popup-btn-group">
      {buttonLabel[0] && (
        <button className="btn-40 btn-darkgray" onClick={onCancel}>
          {buttonLabel[0]}
        </button>
      )}
      {buttonLabel[1] && (
        <button className="btn-40 btn-blue" onClick={onConfirm}>
          {buttonLabel[1]}
        </button>
      )}
    </div>
  );
};
