Skip to content

Commit

Permalink
feat: warnings modal
Browse files Browse the repository at this point in the history
  • Loading branch information
valeriocomo committed Dec 16, 2024
1 parent d94e06d commit 1951fb8
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions src/app/components/WarningModal.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Modal, ModalBody } from "design-react-kit";
import { Icon, Modal, ModalBody } from "design-react-kit";
import { useTranslation } from "react-i18next";

interface Props {
Expand All @@ -15,12 +15,25 @@ export const WarningModal = ({ display, toggle, warnings = [] }: Props): JSX.Ele
isOpen={display}
toggle={toggle}>
<ModalBody>
<h2>{t("editor.warnings")}</h2>
<div>
<h3><Icon icon="it-warning-circle" color="warning" title={t("editor.warnings")} />&nbsp;{t("editor.warnings")}</h3>
<div className="it-list-wrapper">
{warnings.length
?
<ul>
{warnings.map(({ key, message }) => <li key={key}><b>{key}:</b> {message}</li>)}
<ul className="it-list">
<li>
{warnings.map(({ key, message }) =>
<li key={key}>
<div className="list-item">
<div className="it-right-zone">
<div>
<h4 className="text m-0">{key}</h4>
<p className="small m-0">{message}</p>
</div>
</div>
</div>
</li>
)}
</li>
</ul>
: <p>Non ci sono warning</p>}

Expand Down

0 comments on commit 1951fb8

Please sign in to comment.