import { useTranslation } from "next-i18next"; import { useState } from "react"; import TrashButton from "./TrashButton"; import { faExclamationTriangle, faCheck, faArrowLeft, faTrashAlt } from "@fortawesome/free-solid-svg-icons"; import { Button, Modal, ModalHeader, ModalBody, ModalFooter, Row, Col } from "reactstrap"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; const ConfirmModal = ({ tabIndex, title, candidates, grades, isTimeLimited, start, finish, emails, restrictResult, className, confirmCallback }) => { const [visibled, setVisibility] = useState(false); const { t } = useTranslation(); const toggle = () => setVisibility(!visibled) return (
Retour aux paramètres

Les candidats

Paramètres du vote

Confirmation

{t("Le vote")}
{t("Question of the election")}
{title}

{t("Candidates/Proposals")}
    {candidates.map((candidate, i) => { if (candidate.label !== "") { return (
  • {candidate.label}
  • ); } else { return
  • ; } })}
{t("Les paramètres")}
{t("Dates")}
{t("The election will take place from")}{" "} {start.toLocaleDateString()}, {t("at")}{" "} {start.toLocaleTimeString()} {" "} {t("to")}{" "} {finish.toLocaleDateString()}, {t("at")}{" "} {finish.toLocaleTimeString()}

{t("Grades")}
{grades.map((mention, i) => { return i < grades.length ? ( {mention.label} ) : ( ); })}

{t("Voters' list")}
{emails.length > 0 ? ( emails.join(", ") ) : (

{t("The form contains no address.")}
{t( "The election will be opened to anyone with the link" )}

)}

{restrictResult ? (
{t("Results available at the close of the vote")}

{t( "The results page will not be accessible until the end date is reached." )}{" "} ({finish.toLocaleDateString()} {t("at")}{" "} {finish.toLocaleTimeString()})

) : (
{t("Results available at any time")}
)}
) } export default ConfirmModal