2022-10-25 12:09:27 +00:00
|
|
|
import React, { useContext } from "react";
|
2022-10-14 19:26:15 +00:00
|
|
|
|
2022-10-25 12:09:27 +00:00
|
|
|
import { AppContext } from "context/app";
|
2022-10-14 19:26:15 +00:00
|
|
|
import { IIntegrationType } from "interfaces/integration";
|
|
|
|
|
import Modal from "components/Modal";
|
|
|
|
|
import Button from "components/buttons/Button";
|
2022-10-27 18:06:57 +00:00
|
|
|
import CustomLink from "components/CustomLink";
|
2022-10-14 19:26:15 +00:00
|
|
|
|
2022-12-14 18:57:57 +00:00
|
|
|
import JiraPreview from "../../../../../../assets/images/jira-vuln-software-preview-400x517@2x.png";
|
|
|
|
|
import ZendeskPreview from "../../../../../../assets/images/zendesk-vuln-software-preview-400x455@2x.png";
|
|
|
|
|
import JiraPreviewPremium from "../../../../../../assets/images/jira-vuln-software-preview-premium-400x517@2x.png";
|
|
|
|
|
import ZendeskPreviewPremium from "../../../../../../assets/images/zendesk-vuln-software-preview-premium-400x455@2x.png";
|
2022-10-14 19:26:15 +00:00
|
|
|
|
|
|
|
|
const baseClass = "preview-ticket-modal";
|
|
|
|
|
|
|
|
|
|
interface IPreviewTicketModalProps {
|
|
|
|
|
onCancel: () => void;
|
|
|
|
|
integrationType: IIntegrationType;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const PreviewTicketModal = ({
|
|
|
|
|
onCancel,
|
|
|
|
|
integrationType,
|
|
|
|
|
}: IPreviewTicketModalProps): JSX.Element => {
|
2022-10-25 12:09:27 +00:00
|
|
|
const { isPremiumTier } = useContext(AppContext);
|
2022-10-14 19:26:15 +00:00
|
|
|
const screenshot =
|
|
|
|
|
integrationType === "jira" ? (
|
|
|
|
|
<img
|
2022-12-14 18:57:57 +00:00
|
|
|
src={isPremiumTier ? JiraPreviewPremium : JiraPreview}
|
2022-10-14 19:26:15 +00:00
|
|
|
alt="Jira ticket"
|
|
|
|
|
className={`${baseClass}__jira-screenshot`}
|
|
|
|
|
/>
|
|
|
|
|
) : (
|
|
|
|
|
<img
|
2022-12-14 18:57:57 +00:00
|
|
|
src={isPremiumTier ? ZendeskPreviewPremium : ZendeskPreview}
|
2022-10-14 19:26:15 +00:00
|
|
|
alt="Zendesk ticket"
|
|
|
|
|
className={`${baseClass}__zendesk-screenshot`}
|
|
|
|
|
/>
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<Modal
|
|
|
|
|
title={"Example ticket"}
|
|
|
|
|
onExit={onCancel}
|
|
|
|
|
onEnter={onCancel}
|
|
|
|
|
className={baseClass}
|
2023-05-17 17:07:38 +00:00
|
|
|
width="large"
|
2022-10-14 19:26:15 +00:00
|
|
|
>
|
|
|
|
|
<>
|
2023-05-17 17:07:38 +00:00
|
|
|
<p className="automations-learn-more">
|
2022-10-14 19:26:15 +00:00
|
|
|
Want to learn more about how automations in Fleet work?{" "}
|
2022-10-27 18:06:57 +00:00
|
|
|
<CustomLink
|
|
|
|
|
url="https://fleetdm.com/docs/using-fleet/automations"
|
|
|
|
|
text="Check out the Fleet documentation"
|
|
|
|
|
newTab
|
|
|
|
|
/>
|
2022-10-14 19:26:15 +00:00
|
|
|
</p>
|
|
|
|
|
<div className={`${baseClass}__example`}>{screenshot}</div>
|
|
|
|
|
<div className="modal-cta-wrap">
|
|
|
|
|
<Button onClick={onCancel} variant="brand">
|
|
|
|
|
Done
|
|
|
|
|
</Button>
|
|
|
|
|
</div>
|
|
|
|
|
</>
|
|
|
|
|
</Modal>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default PreviewTicketModal;
|