-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b74f390
commit a81150c
Showing
18 changed files
with
1,292 additions
and
159 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export default { | ||
plugins: { | ||
tailwindcss: {}, | ||
autoprefixer: {}, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
hello this is a test | ||
|
||
# test 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
hello this is a test | ||
|
||
# test 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
hello this is a test | ||
|
||
# test 3this is a test another |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
hello this is a test | ||
|
||
# test twerk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
hello this is a test | ||
|
||
# test 2asdfsadoohtest | ||
|
||
this is a new test | ||
|
||
**intersteingasdfasd** | ||
|
||
## this is another test asdf | ||
|
||
sadfasd |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import { useState } from "react"; | ||
import DirectoryNode from "../../../models/DirectoryNode"; | ||
import { ChevronRight } from "lucide-react"; | ||
|
||
export function Folder({ | ||
node, | ||
depth, | ||
handleFileSelect, | ||
}: { | ||
node: DirectoryNode | null; | ||
depth: number; | ||
handleFileSelect: (file: DirectoryNode) => void; | ||
}) { | ||
const [expanded, setExpanded] = useState(depth === 0); | ||
if (!node) return null; | ||
|
||
return ( | ||
<div key={node.name}> | ||
{depth === 0 ? null : ( | ||
<div | ||
className="p-2 hover:bg-zinc-200 rounded" | ||
onClick={() => { | ||
setExpanded(!expanded); | ||
}} | ||
> | ||
<ChevronRight /> | ||
<h3 className="text-sm font-semibold">{node.name}</h3> | ||
</div> | ||
)} | ||
<div className={`ml-4 ${expanded ? "block" : "hidden"}`}> | ||
{node.children.map((child) => ( | ||
<div key={child.name}> | ||
{child.children.length === 0 ? ( // Render file | ||
<div | ||
className={`ml-${(depth + 1) * 20} cursor-pointer | ||
text-sm | ||
p-2 hover:bg-zinc-200 rounded ${ | ||
child.unsavedChanges ? "italic" : "" | ||
}`} | ||
onClick={() => { | ||
handleFileSelect(child); | ||
}} | ||
> | ||
{child.name} | ||
{child.unsavedChanges ? "*" : ""} | ||
</div> | ||
) : ( | ||
<Folder | ||
node={child} | ||
depth={depth + 1} | ||
handleFileSelect={handleFileSelect} | ||
/> // Recursively render directory | ||
)} | ||
</div> | ||
))} | ||
</div> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.