// import { useState, MouseEvent } from "react"; // import dayjs from "dayjs"; import { useTranslation } from 'react-i18next'; import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter'; import { vscDarkPlus } from 'react-syntax-highlighter/dist/esm/styles/prism'; import { useAppSelector } from '../../app/store'; import Button from '../../common/component/styled/Button'; import Input from '../../common/component/styled/Input'; import useCopy from '../../common/hook/useCopy'; import IconQuestion from '../../assets/icons/question.svg'; const Row = ({ paramKey, paramDefault, remarks }: { paramKey: string, paramDefault: string | number, remarks: string }) => { return {paramKey} {paramDefault} {remarks} ; }; export default function Widget() { const loginUid = useAppSelector(store => store.authData.user?.uid); const widgetLink = `${location.origin}/widget.html?hostId=${loginUid}`; const { t } = useTranslation("setting", { keyPrefix: "widget" }); const { t: ct } = useTranslation(); const { copied, copy } = useCopy({ enableToast: false }); const copyLink = () => { copy(widgetLink); }; // const disableBtn = !reachLimit; return (
{t('tip')}
{`\n`}
{t('config')}:
{[t('param_key'), t('default_value'), t('remark')].map(title => )} {[{ paramKey: "host-id", paramDefault: 1, remarks: t("param_host") }, { paramKey: "theme-color", paramDefault: "#1fe1f9", remarks: t("param_theme_color") }, { paramKey: "close-width", paramDefault: `48(px)`, remarks: t("param_close_width") }, { paramKey: "close-height", paramDefault: `48(px)`, remarks: t("param_close_height") }, { paramKey: "open-width", paramDefault: `380(px)`, remarks: t("param_open_width") }, { paramKey: "open-height", paramDefault: `680(px)`, remarks: t("param_open_height") } ].map(row => )}
{title}
* All the parameters are optional, and prefixed by data-

{t("share_link")} {t("widget_faq")}

); }