+
+ {(props.onSave || props.onReload) && (
+
+
+ {props.onSave && (
+
+ props.onSave?.()}
+ >
+
+
+
+ )}
+ {props.onReload && (
+
+ props.onReload?.()}
+ >
+
+
+
+ )}
+
+
+ )}
+
+ );
+}
+
+/** A version of the TemplateEditorTextArea that is connected to the DirectoryEditor context */
+export function TemplateEditorDirectoryEditorTextArea(props: {
+ errorText?: string;
+}) {
+ const directoryEditor = useDirectoryEditor();
+
+ const actions = directoryEditor.selectedFile?.dirty
+ ? {
+ onSave: () => directoryEditor.save(),
+ onReload: () => directoryEditor.reload(),
+ }
+ : undefined;
+
+ return (
+