[data-slot=section]+[data-slot=section]]:mt-8'
+ )}
+ />
+ )
+}
+
+export function SidebarFooter({ className, ...props }: React.ComponentPropsWithoutRef<'div'>) {
+ return (
+
[data-slot=section]+[data-slot=section]]:mt-2.5'
+ )}
+ />
+ )
+}
+
+export function SidebarSection({ className, ...props }: React.ComponentPropsWithoutRef<'div'>) {
+ let id = useId()
+
+ return (
+
+
+
+ )
+}
+
+export function SidebarDivider({ className, ...props }: React.ComponentPropsWithoutRef<'hr'>) {
+ return
+}
+
+export function SidebarSpacer({ className, ...props }: React.ComponentPropsWithoutRef<'div'>) {
+ return
+}
+
+export function SidebarHeading({ className, ...props }: React.ComponentPropsWithoutRef<'h3'>) {
+ return (
+
+ )
+}
+
+export const SidebarItem = forwardRef(function SidebarItem(
+ {
+ current,
+ className,
+ children,
+ ...props
+ }: { current?: boolean; className?: string; children: React.ReactNode } & (
+ | Omit
+ | Omit, 'type' | 'className'>
+ ),
+ ref: React.ForwardedRef
+) {
+ let classes = clsx(
+ // Base
+ 'flex w-full items-center gap-3 rounded-lg px-2 py-2.5 text-left text-base/6 font-medium text-zinc-950 sm:py-2 sm:text-sm/5',
+ // Leading icon/icon-only
+ 'data-[slot=icon]:*:size-6 data-[slot=icon]:*:shrink-0 data-[slot=icon]:*:fill-zinc-500 sm:data-[slot=icon]:*:size-5',
+ // Trailing icon (down chevron or similar)
+ 'data-[slot=icon]:last:*:ml-auto data-[slot=icon]:last:*:size-5 sm:data-[slot=icon]:last:*:size-4',
+ // Avatar
+ 'data-[slot=avatar]:*:-m-0.5 data-[slot=avatar]:*:size-7 data-[slot=avatar]:*:[--ring-opacity:10%] sm:data-[slot=avatar]:*:size-6',
+ // Hover
+ 'data-[hover]:bg-zinc-950/5 data-[slot=icon]:*:data-[hover]:fill-zinc-950',
+ // Active
+ 'data-[active]:bg-zinc-950/5 data-[slot=icon]:*:data-[active]:fill-zinc-950',
+ // Current
+ 'data-[slot=icon]:*:data-[current]:fill-zinc-950',
+ // Dark mode
+ 'dark:text-white dark:data-[slot=icon]:*:fill-zinc-400',
+ 'dark:data-[hover]:bg-white/5 dark:data-[slot=icon]:*:data-[hover]:fill-white',
+ 'dark:data-[active]:bg-white/5 dark:data-[slot=icon]:*:data-[active]:fill-white',
+ 'dark:data-[slot=icon]:*:data-[current]:fill-white'
+ )
+
+ return (
+
+ {current && (
+
+ )}
+ {'href' in props ? (
+
+
+ {children}
+
+
+ ) : (
+
+ {children}
+
+ )}
+
+ )
+})
+
+export function SidebarLabel({ className, ...props }: React.ComponentPropsWithoutRef<'span'>) {
+ return
+}
diff --git a/moon/src/components/layout.tsx b/moon/src/components/layout.tsx
deleted file mode 100644
index a75b1f1db..000000000
--- a/moon/src/components/layout.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import Navbar from './TopNavbar'
-import Footer from './Bottombar'
-
-export default function Layout({ children }) {
- return (
-
-
-
- {children}
-
-
-
- )
-}
\ No newline at end of file
diff --git a/moon/src/pages/404.tsx b/moon/src/pages/404.tsx
deleted file mode 100644
index f3bccde3a..000000000
--- a/moon/src/pages/404.tsx
+++ /dev/null
@@ -1,13 +0,0 @@
-import React from 'react';
-import { Button, Result } from 'antd/lib';
-
-const App: React.FC = () => (
- Back Home}
- />
-);
-
-export default App;
\ No newline at end of file
diff --git a/moon/src/pages/500.tsx b/moon/src/pages/500.tsx
deleted file mode 100644
index 674fcd1db..000000000
--- a/moon/src/pages/500.tsx
+++ /dev/null
@@ -1,13 +0,0 @@
-import React from 'react';
-import { Button, Result } from 'antd/lib';
-
-const App: React.FC = () => (
- Back Home}
- />
-);
-
-export default App;
\ No newline at end of file
diff --git a/moon/src/pages/_app.tsx b/moon/src/pages/_app.tsx
deleted file mode 100644
index 34e80d059..000000000
--- a/moon/src/pages/_app.tsx
+++ /dev/null
@@ -1,11 +0,0 @@
-import '../styles/globals.css'
-import type { AppProps } from 'next/app'
-import Layout from '../components/layout'
-
-export default function MyApp({ Component, pageProps }: AppProps) {
- return (
-
-
-
- )
-}
\ No newline at end of file
diff --git a/moon/src/pages/api/blob.ts b/moon/src/pages/api/blob.ts
deleted file mode 100644
index cd9a41f9a..000000000
--- a/moon/src/pages/api/blob.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-import axios from 'axios';
-
-export default async function handler(req, res) {
- const endpoint = process.env.NEXT_MEGA_API_URL;
- const { path } = req.query;
- try {
- const apiUrl = `${endpoint}/api/v1/blob?path=${path}`;
- const response = await axios.get(apiUrl);
- const data = response.data;
- res.status(200).json(data);
- } catch (error) {
-
- console.error('Error fetching blob data:', error);
- res.status(500).json({ error: 'Error fetching blob data' });
- }
-}
diff --git a/moon/src/pages/api/mr.ts b/moon/src/pages/api/mr.ts
deleted file mode 100644
index a1837b065..000000000
--- a/moon/src/pages/api/mr.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import axios from 'axios';
-
-export default async function handler(req, res) {
- const endpoint = process.env.NEXT_MEGA_API_URL;
- const { status } = req.query;
- try {
- const apiUrl = `${endpoint}/api/v1/mr-list?status=${status}`;
- const response = await axios.get(apiUrl);
- const data = response.data;
- res.status(200).json(data);
- } catch (error) {
- console.error('Error fetching data:', error);
- res.status(500).json({ error: 'Error fetching data' });
- }
-}
diff --git a/moon/src/pages/api/mr/[id].ts b/moon/src/pages/api/mr/[id].ts
deleted file mode 100644
index f43cfdf9d..000000000
--- a/moon/src/pages/api/mr/[id].ts
+++ /dev/null
@@ -1,16 +0,0 @@
-import axios from 'axios';
-
-export default async function handler(req, res) {
- const endpoint = process.env.NEXT_MEGA_API_URL;
- const { id } = req.query;
-
- try {
- const apiUrl = `${endpoint}/api/v1/mr-detail/${id}`;
- const response = await axios.get(apiUrl);
- const data = response.data;
- res.status(200).json(data);
- } catch (error) {
- console.error('Error fetching data:', error);
- res.status(500).json({ error: 'Error fetching data' });
- }
-}
diff --git a/moon/src/pages/api/mr/files.ts b/moon/src/pages/api/mr/files.ts
deleted file mode 100644
index 11959e362..000000000
--- a/moon/src/pages/api/mr/files.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-import axios from 'axios';
-
-export default async function handler(req, res) {
- const endpoint = process.env.NEXT_MEGA_API_URL;
- const { id } = req.query;
-
- try {
- const apiUrl = `${endpoint}/api/v1/mr-files/${id}`;
- const response = await axios.get(apiUrl);
- const data = response.data;
- res.status(200).json(data);
- } catch (error) {
- console.error('Error fetching data:', error);
- res.status(500).json({ error: 'Error fetching data' });
- }
-}
diff --git a/moon/src/pages/api/mr/merge.ts b/moon/src/pages/api/mr/merge.ts
deleted file mode 100644
index 900b1d25f..000000000
--- a/moon/src/pages/api/mr/merge.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-import axios from 'axios';
-
-export default async function handler(req, res) {
- const endpoint = process.env.NEXT_MEGA_API_URL;
- const { id } = req.query;
-
- try {
- const apiUrl = `${endpoint}/api/v1/merge/${id}`;
- const response = await axios.post(apiUrl);
- const data = response.data;
- res.status(200).json(data);
- } catch (error) {
- console.error('Error fetching data:', error);
- res.status(500).json({ error: 'Error fetching data' });
- }
-}
diff --git a/moon/src/pages/api/tree-commit.ts b/moon/src/pages/api/tree-commit.ts
deleted file mode 100644
index ea0ca4e83..000000000
--- a/moon/src/pages/api/tree-commit.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-import axios from 'axios';
-
-export default async function handler(req, res) {
-
- const endpoint = process.env.NEXT_MEGA_API_URL;
-
- const { path } = req.query;
-
- try {
- const apiUrl = `${endpoint}/api/v1/tree-commit-info?path=${path}`;
-
- const response = await axios.get(apiUrl);
-
- const treeData = response.data;
-
- res.status(200).json(treeData);
- } catch (error) {
-
- console.error('Error fetching tree-commit data:', error);
- res.status(500).json({ error: 'Error fetching tree-commit data' });
- }
-}
diff --git a/moon/src/pages/api/tree.ts b/moon/src/pages/api/tree.ts
deleted file mode 100644
index 2f39cad20..000000000
--- a/moon/src/pages/api/tree.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-// /pages/api/tree.js
-
-import axios from 'axios';
-
-export default async function handler(req, res) {
-
- const endpoint = process.env.NEXT_MEGA_API_URL;
-
- const { path } = req.query;
-
- try {
- const apiUrl = `${endpoint}/api/v1/tree?path=${path}`;
-
- const response = await axios.get(apiUrl);
-
- const treeData = response.data;
-
- res.status(200).json(treeData);
- } catch (error) {
-
- console.error('Error fetching tree data:', error);
- res.status(500).json({ error: 'Error fetching tree data' });
- }
-}
diff --git a/moon/src/pages/blob/[...path].tsx b/moon/src/pages/blob/[...path].tsx
deleted file mode 100644
index d5e5c711b..000000000
--- a/moon/src/pages/blob/[...path].tsx
+++ /dev/null
@@ -1,25 +0,0 @@
-import { useRouter } from 'next/router'
-import CodeContent from '../../components/CodeContent';
-import Bread from '../../components/BreadCrumb';
-
-export default function BlobPage({ fileContent }) {
- const router = useRouter();
- return (
-
-
-
-
- )
-}
-
-export async function getServerSideProps(context) {
- const { path } = context.query;
- const res = await fetch(`http://localhost:3000/api/blob?path=/${path.join('/')}`);
- const response = await res.json();
- var fileContent = response.data;
- return {
- props: {
- fileContent,
- },
- };
-}
\ No newline at end of file
diff --git a/moon/src/pages/index.tsx b/moon/src/pages/index.tsx
deleted file mode 100644
index 210a7cbb8..000000000
--- a/moon/src/pages/index.tsx
+++ /dev/null
@@ -1,34 +0,0 @@
-import CodeTable from '../components/CodeTable';
-
-export default function HomePage({ directory, readmeContent }) {
- return (
-
-
-
- );
-}
-
-export async function getServerSideProps(context) {
- const { path } = context.query;
- // obtain the current directory
- const res = await fetch(`http://localhost:3000/api/tree-commit?path=/`);
- const response = await res.json();
- const directory = response.data;
- var readmeContent = '';
- // get the readme file content
- for (const project of directory || []) {
- if (project.name === 'README.md' && project.content_type === 'file') {
- const res = await fetch(`http://localhost:3000/api/blob?path=/${path.join('/')}/README.md`);
- const response = await res.json();
- readmeContent = response.data;
- break;
- }
- }
-
- return {
- props: {
- directory,
- readmeContent,
- },
- };
-}
diff --git a/moon/src/pages/mr/[...id].tsx b/moon/src/pages/mr/[...id].tsx
deleted file mode 100644
index 3ff1851e2..000000000
--- a/moon/src/pages/mr/[...id].tsx
+++ /dev/null
@@ -1,22 +0,0 @@
-import MergeDetail from "../../components/MergeDetail";
-
-
-export default function MRDetailPage({ mrDetail }) {
- return (
-
-
-
- )
-}
-
-export async function getServerSideProps(context) {
- const { id } = context.query;
- const res = await fetch(`http://localhost:3000/api/mr/${id}`);
- const response = await res.json();
- const mrDetail = response.data;
- return {
- props: {
- mrDetail,
- },
- };
-}
\ No newline at end of file
diff --git a/moon/src/pages/mr/index.tsx b/moon/src/pages/mr/index.tsx
deleted file mode 100644
index bb5ccfe32..000000000
--- a/moon/src/pages/mr/index.tsx
+++ /dev/null
@@ -1,22 +0,0 @@
-import { useRouter } from 'next/router'
-import MergeList from "../../components/MergeList";
-
-export default function MergeRequestPage({ mrList }) {
- const router = useRouter();
- return (
-
-
-
- )
-}
-
-export async function getServerSideProps(context) {
- const res = await fetch(`http://localhost:3000/api/mr`);
- const response = await res.json();
- const mrList = response.data;
- return {
- props: {
- mrList,
- },
- };
-}
\ No newline at end of file
diff --git a/moon/src/pages/tree/[...path].tsx b/moon/src/pages/tree/[...path].tsx
deleted file mode 100644
index 75f3feaad..000000000
--- a/moon/src/pages/tree/[...path].tsx
+++ /dev/null
@@ -1,37 +0,0 @@
-import CodeTable from '../../components/CodeTable'
-import Bread from '../../components/BreadCrumb'
-import RepoTree from '../../components/RepoTree'
-
-export default function TreePage({ directory, readmeContent }) {
- return (
-
-
-
-
-
- );
-}
-
-export async function getServerSideProps(context) {
- const { path } = context.query;
- // obtain the current directory
- const res = await fetch(`http://localhost:3000/api/tree-commit?path=/${path.join('/')}`);
- const response = await res.json();
- const directory = response.data;
- var readmeContent = '';
- // get the readme file content
- for (const project of directory || []) {
- if (project.name === 'README.md' && project.content_type === 'file') {
- const res = await fetch(`http://localhost:3000/api/blob?path=/${path.join('/')}/README.md`);
- const response = await res.json();
- readmeContent = response.data;
- break;
- }
- }
- return {
- props: {
- directory,
- readmeContent,
- },
- };
-}
diff --git a/moon/tsconfig.json b/moon/tsconfig.json
new file mode 100644
index 000000000..204075550
--- /dev/null
+++ b/moon/tsconfig.json
@@ -0,0 +1,40 @@
+{
+ "compilerOptions": {
+ "lib": [
+ "dom",
+ "dom.iterable",
+ "esnext"
+ ],
+ "allowJs": true,
+ "skipLibCheck": true,
+ "strict": false,
+ "noEmit": true,
+ "incremental": true,
+ "module": "esnext",
+ "esModuleInterop": true,
+ "moduleResolution": "node",
+ "resolveJsonModule": true,
+ "isolatedModules": true,
+ "jsx": "preserve",
+ "plugins": [
+ {
+ "name": "next"
+ }
+ ],
+ "paths": {
+ "@/*": [
+ "./src/*"
+ ]
+ },
+ "strictNullChecks": true
+ },
+ "include": [
+ "next-env.d.ts",
+ ".next/types/**/*.ts",
+ "**/*.ts",
+ "**/*.tsx"
+, "src/pages/_app.back" ],
+ "exclude": [
+ "node_modules"
+ ]
+}