("markdown");
+
+ return (
+
+
+
+
+
+
+
+
+ );
+}
diff --git a/src/app/@rich-header.tsx b/src/app/@rich-header.tsx
new file mode 100644
index 0000000..e3a2179
--- /dev/null
+++ b/src/app/@rich-header.tsx
@@ -0,0 +1,39 @@
+"use client";
+
+import { Button } from "~/components/ui/button";
+import { CardHeader, CardTitle } from "~/components/ui/card";
+import { Separator } from "~/components/ui/separator";
+
+type Props = {
+ title: string;
+ view: "markdown" | "raw";
+ onViewChange: (value: "markdown" | "raw") => void;
+};
+export default function RichHeader({ title, view, onViewChange }: Props) {
+ return (
+
+
+
{title}
+
+
+
+
+
+
+
+ );
+}
diff --git a/src/app/[...rest]/page.tsx b/src/app/[...rest]/page.tsx
index 97baa60..8d9cd9f 100644
--- a/src/app/[...rest]/page.tsx
+++ b/src/app/[...rest]/page.tsx
@@ -14,16 +14,9 @@ import { getFileType } from "~/utils/previewHelper";
import FileBrowser from "../@explorer";
import Header from "../@header";
import HeaderButton from "../@header.button";
-import Markdown from "../@markdown";
import Password from "../@password";
-import PreviewAction from "../@preview.action";
-import PreviewAudio from "../@preview.audio";
-import PreviewDoc from "../@preview.doc";
-import PreviewImage from "../@preview.image";
-import PreviewManga from "../@preview.manga";
-import PreviewRich from "../@preview.rich";
-import PreviewUnknown from "../@preview.unknown";
-import PreviewVideo from "../@preview.video";
+import FilePreviewLayout from "../@preview.layout";
+import Readme from "../@readme";
import {
CheckPassword,
CheckPaths,
@@ -141,76 +134,51 @@ export default async function RestPage({ params: { rest } }: Props) {
slot='content'
className='w-full'
>
-
-
- {isFile ? (
-
-
- {data.name}
-
-
- ) : (
-
- Browse files
-
-
- )}
-
-
-
- {isFile ? (
-
- {fileType === "image" ? (
-
- ) : fileType === "audio" ? (
-
- ) : fileType === "video" ? (
-
- ) : fileType === "code" ? (
-
- ) : fileType === "text" ? (
-
- ) : fileType === "markdown" ? (
-
- ) : fileType === "document" ? (
-
- ) : fileType === "pdf" ? (
-
- ) : fileType === "manga" ? (
-
- ) : (
-
- )}
-
- ) : (
-
+ ) : (
+ <>
+
+
+
+ Browse files
+
+
+
+
+
+
+
+
+ {readme && (
+
+ //
+ //
+ //
+ // README.md
+ //
+ //
+ //
+ //
+ //
+ //
+ //
)}
-
-
+ >
+ )}