({
appliedOptions,
}: {
appliedOptions: PluginOptions | null;
})
| 29 | loader.config({monaco}); |
| 30 | |
| 31 | export default function ConfigEditor({ |
| 32 | appliedOptions, |
| 33 | }: { |
| 34 | appliedOptions: PluginOptions | null; |
| 35 | }): React.ReactElement { |
| 36 | const [isExpanded, setIsExpanded] = useState(false); |
| 37 | |
| 38 | return ( |
| 39 | // TODO: Use <Activity> when it is compatible with Monaco: https://github.com/suren-atoyan/monaco-react/issues/753 |
| 40 | <> |
| 41 | <div |
| 42 | style={{ |
| 43 | display: isExpanded ? 'block' : 'none', |
| 44 | }}> |
| 45 | <ExpandedEditor |
| 46 | onToggle={() => { |
| 47 | startTransition(() => { |
| 48 | addTransitionType(CONFIG_PANEL_TRANSITION); |
| 49 | setIsExpanded(false); |
| 50 | }); |
| 51 | }} |
| 52 | appliedOptions={appliedOptions} |
| 53 | /> |
| 54 | </div> |
| 55 | <div |
| 56 | style={{ |
| 57 | display: !isExpanded ? 'block' : 'none', |
| 58 | }}> |
| 59 | <CollapsedEditor |
| 60 | onToggle={() => { |
| 61 | startTransition(() => { |
| 62 | addTransitionType(CONFIG_PANEL_TRANSITION); |
| 63 | setIsExpanded(true); |
| 64 | }); |
| 65 | }} |
| 66 | /> |
| 67 | </div> |
| 68 | </> |
| 69 | ); |
| 70 | } |
| 71 | |
| 72 | function ExpandedEditor({ |
| 73 | onToggle, |
nothing calls this directly
no test coverage detected