import React from "react"; import { Dispatch, SetStateAction } from "react"; import { toBase64 } from "../util"; import { EmailTemplate2Config } from "./email-template-2"; export default function EmailTemplate2Controls({ config, setConfig, }: { config: EmailTemplate2Config; setConfig: Dispatch>; }): JSX.Element { return (
{config.popup_type !== "none" ? (
{ const popup_screenshot_base64 = await toBase64( e.target.files[0] ); setConfig((v) => ({ ...v, popup_screenshot_base64, })); }, }} />
) : ( "" )} {config.popup_type === "consent" ? (
setConfig((v) => ({ ...v, popup_accept_all_text: e.target.value, })), }} />
) : ( "" )}
{config.popup_type !== "none" ? (
setConfig((v) => ({ ...v, popup_mentions_passive_consent: e.target.checked, })) } />
) : ( "" )} {config.popup_mentions_passive_consent ? (
setConfig((v) => ({ ...v, popup_passive_consent_text: e.target.value, })) } />
) : ( "" )}
); }