UNPKG

@websolutespa/payload-plugin-bowl-llm

Version:

LLM plugin for Bowl PayloadCms plugin

68 lines (67 loc) 2.81 kB
'use client'; import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import Editor from '@monaco-editor/react'; import { MinimalTemplate } from '@payloadcms/next/templates'; import { Button, useModal, useTheme, XIcon } from '@payloadcms/ui'; import React from 'react'; import { options } from '../../options'; import './CustomThemeDescriptionModal.scss'; export const CustomThemeDescriptionModal = ({ modalId, value })=>{ // const { t } = useTranslation(); const { closeModal } = useModal(); const { theme } = useTheme(); const onClose = ()=>{ console.log('onClose', modalId); closeModal(modalId); }; const classes = ''; const readOnly = true; const defaultTheme = options.defaultTheme || {}; return /*#__PURE__*/ _jsx(MinimalTemplate, { width: "wide", children: /*#__PURE__*/ _jsxs("div", { className: 'custom-theme-description-modal', children: [ /*#__PURE__*/ _jsxs("header", { className: 'custom-theme-description-modal__header', children: [ /*#__PURE__*/ _jsx("h3", { children: /*#__PURE__*/ _jsx("span", { children: "Custom theme full specs" }) }), /*#__PURE__*/ _jsx(Button, { buttonStyle: "none", onClick: onClose, children: /*#__PURE__*/ _jsx(XIcon, {}) }) ] }), /*#__PURE__*/ _jsx("main", { className: 'custom-theme-description-modal__main', children: /*#__PURE__*/ _jsx(Editor, { className: classes, height: "80vh", loading: /*#__PURE__*/ _jsx(_Fragment, { children: "loading..." }), options: { detectIndentation: true, minimap: { enabled: false }, readOnly: Boolean(readOnly), scrollBeyondLastLine: false, tabSize: 2, wordWrap: 'on' }, theme: theme === 'dark' ? 'vs-dark' : 'vs', value: value ? JSON.stringify(defaultTheme, null, 2) : '', language: "json" }) }) ] }) }); }; //# sourceMappingURL=CustomThemeDescriptionModal.js.map