Skip to content

Commit

Permalink
[autofix.ci] apply automated fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
autofix-ci[bot] authored Nov 22, 2024
1 parent a05ff89 commit 5eff79d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions examples/experimental/nodes/frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ const App: React.FC = () => {
// Split path into parts
const parts = path.split('/').filter(Boolean);
const fileName = parts[parts.length - 1];

// Create new file node
const newFile: FileNode = {
name: fileName,
Expand All @@ -124,14 +124,14 @@ const App: React.FC = () => {
const newTree = [...prev.tree];
let currentLevel = newTree;
for (let i = 0; i < parts.length - 1; i++) {
const folder = currentLevel.find(node =>
const folder = currentLevel.find(node =>
node.type === 'folder' && node.name === parts[i]
);
if (folder && folder.children) {
currentLevel = folder.children;
}
}

// Add new file to appropriate level if it doesn't exist
if (!currentLevel.find(node => node.path === path)) {
currentLevel.push(newFile);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const CodeEditor: React.FC<CodeEditorProps> = ({ code, onChange, filename }) =>
// Add empty lines to fill the editor
const fillEmptyLines = (content: string | undefined) => {
if (!content) return '\n'.repeat(50); // Return 50 empty lines if no content

const lines = content.split('\n');
const currentLines = lines.length;
if (currentLines < 50) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export const FileSystem: React.FC<FileSystemProps> = ({ fileSystem, onFileSelect
<>
<div id="file-explorer-header">Folders</div>
<div className="file-explorer">
{fileSystem.map(node =>
{fileSystem.map(node =>
node.type === 'folder' ? renderFolder(node) : renderItem(node)
)}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ export interface FileSystemState {
files: {
[path: string]: string; // path -> content mapping
};
}
}

0 comments on commit 5eff79d

Please sign in to comment.