mirror of
https://github.com/datahub-project/datahub.git
synced 2025-08-03 23:07:53 +00:00
26 lines
606 B
TypeScript
26 lines
606 B
TypeScript
import React from 'react';
|
|
import Editor from '@monaco-editor/react';
|
|
|
|
type Props = {
|
|
initialText: string;
|
|
onChange: (change: any) => void;
|
|
};
|
|
|
|
export const YamlEditor = ({ initialText, onChange }: Props) => {
|
|
return (
|
|
<Editor
|
|
options={{
|
|
minimap: { enabled: false },
|
|
scrollbar: {
|
|
vertical: 'hidden',
|
|
horizontal: 'hidden',
|
|
},
|
|
}}
|
|
height="55vh"
|
|
defaultLanguage="yaml"
|
|
value={initialText}
|
|
onChange={onChange}
|
|
/>
|
|
);
|
|
};
|