feature: empty brain

This commit is contained in:
iMADi-ARCH 2023-05-22 23:54:18 +05:30
parent 9103e97ef0
commit bfc4d458fe

View File

@ -3,6 +3,8 @@ import { useState, useEffect } from "react";
import axios from "axios"; import axios from "axios";
import DocumentItem from "./DocumentItem"; import DocumentItem from "./DocumentItem";
import { Document } from "./types"; import { Document } from "./types";
import Button from "../components/ui/Button";
import Link from "next/link";
export default function ExplorePage() { export default function ExplorePage() {
const [documents, setDocuments] = useState<Document[]>([]); const [documents, setDocuments] = useState<Document[]>([]);
@ -33,9 +35,18 @@ export default function ExplorePage() {
<h2 className="opacity-50">View what&rsquo;s in your second brain</h2> <h2 className="opacity-50">View what&rsquo;s in your second brain</h2>
</div> </div>
<div className="w-full max-w-xl flex flex-col gap-5"> <div className="w-full max-w-xl flex flex-col gap-5">
{documents.map((document, index) => ( {documents.length !== 0 ? (
documents.map((document, index) => (
<DocumentItem key={index} document={document} /> <DocumentItem key={index} document={document} />
))} ))
) : (
<div className="flex flex-col items-center justify-center mt-10 gap-1">
<p className="text-center">Oh No, Your Brain is empty.</p>
<Link href="/upload">
<Button>Upload Files</Button>
</Link>
</div>
)}
</div> </div>
</div> </div>
); );