feat: add global server custom CSS (#6753)
* feat: add global server custom CSS * refactor: reuse CodeMirror for CSS editors
This commit is contained in:
1 parent
ee30aa13cf
commit
f57a660088
18 files changed
+152
-359
No files matched your search
@@ -0,0 +1,38 @@
|
||||
"use client";
|
||||
|
||||
import { CodeEditor } from "~/components/custom-widgets/code-editor";
|
||||
|
||||
interface CustomCssEditorProps {
|
||||
id: string;
|
||||
label: string;
|
||||
description: string;
|
||||
value?: string;
|
||||
onChange: (value: string) => void;
|
||||
error?: React.ReactNode;
|
||||
actions?: React.ReactNode;
|
||||
}
|
||||
|
||||
export const CustomCssEditor = ({
|
||||
id,
|
||||
label,
|
||||
description,
|
||||
value = "",
|
||||
onChange,
|
||||
error,
|
||||
actions,
|
||||
}: CustomCssEditorProps) => {
|
||||
return (
|
||||
<CodeEditor
|
||||
id={id}
|
||||
label={label}
|
||||
description={description}
|
||||
value={value}
|
||||
onChange={onChange}
|
||||
error={error}
|
||||
language="css"
|
||||
height="250px"
|
||||
maxLength={16_384}
|
||||
actions={actions}
|
||||
/>
|
||||
);
|
||||
};
|
||||
Reference in new issue
Block a user