import { FC } from "react";
import { Aligment, Modal, Text } from "venice-ui";
import { dictionary } from "../../untils/dictionary";
import { t } from "../../helpers/userHelper";

interface IExportModal {
  handleCancel: () => void;
  handleConfirm: () => void;
  weldmap?: boolean;
  sectionLevel?: boolean;
  name: string;
  isOpen: boolean;
}

export const ExportModal: FC<IExportModal> = ({
  handleCancel,
  handleConfirm,
  name,
  weldmap = false,
  sectionLevel = false,
  isOpen,
}) => {
  return (
    <Modal
      title={t(dictionary.export)}
      handleClose={handleCancel}
      handleConfirm={handleConfirm}
      isOpen={isOpen}
      exitOnEsc={true}
      headerDivader={true}
      labels={{
        primary: t(dictionary.export),
        secondary: t(dictionary.cancel),
      }}
    >
      <Aligment direction="row">
        {weldmap ? (
          <Text>
            {" "}
            {t(dictionary.exportWeldMap)} {t(dictionary.forSection)}: {name}{" "}
          </Text>
        ) : (
          <Text>
            {" "}
            {t(dictionary.exportWeldLog)}{" "}
            {sectionLevel ? t(dictionary.forSection) : t(dictionary.forProject)}
            : {name}
          </Text>
        )}
      </Aligment>
    </Modal>
  );
};
