[REPO REFACTOR]: changed to a better git repository structure with branches

This commit is contained in:
2025-11-01 05:49:49 +01:00
parent 4d0f44e995
commit 589215b2bc
76 changed files with 3529 additions and 0 deletions

View File

@@ -0,0 +1,59 @@
import Editor from "@monaco-editor/react";
import { useTheme } from "@/hooks/useTheme";
import { useRef } from "react";
import PropTypes from "prop-types";
import { loader } from '@monaco-editor/react';
loader.config({
'vs/nls': {
availableLanguages: { '*': 'es' },
},
});
const CodeEditor = ({ className = "", syntax, readOnly, onChange, value }) => {
const { theme } = useTheme();
const editorRef = useRef(null);
const onMount = (editor) => {
editorRef.current = editor;
editor.focus();
}
return (
<div className={`code-editor ${className}`}>
<Editor
language={syntax || "plaintext"}
value={value || ""}
theme={theme === "dark" ? "vs-dark" : "vs-light"}
onChange={(value) => onChange?.(value)}
onMount={onMount}
options={{
minimap: { enabled: false },
automaticLayout: true,
fontFamily: 'Fira Code',
fontLigatures: true,
fontSize: 18,
lineHeight: 1.5,
scrollbar: { verticalScrollbarSize: 0 },
wordWrap: "on",
formatOnPaste: true,
suggest: {
showFields: true,
showFunctions: true,
},
readOnly: readOnly || false,
}}
/>
</div>
);
};
CodeEditor.propTypes = {
className: PropTypes.string,
syntax: PropTypes.string,
readOnly: PropTypes.bool,
onChange: PropTypes.func,
value: PropTypes.string,
};
export default CodeEditor;