File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 1
1
import { useTeam } from "@/context/team-context" ;
2
2
import { FolderPlusIcon , PlusIcon } from "lucide-react" ;
3
-
3
+ import ErrorPage from "next/error" ;
4
4
import { AddDocumentModal } from "@/components/documents/add-document-modal" ;
5
5
import { DocumentsList } from "@/components/documents/documents-list" ;
6
6
import { AddFolderModal } from "@/components/folders/add-folder-modal" ;
@@ -11,10 +11,17 @@ import { Separator } from "@/components/ui/separator";
11
11
import useDocuments , { useRootFolders } from "@/lib/swr/use-documents" ;
12
12
13
13
export default function Documents ( ) {
14
- const { documents } = useDocuments ( ) ;
14
+ const { documents, error } = useDocuments ( ) ;
15
15
const { folders } = useRootFolders ( ) ;
16
16
const teamInfo = useTeam ( ) ;
17
17
18
+ if ( error && error . status === 404 ) {
19
+ return < ErrorPage statusCode = { 404 } /> ;
20
+ }
21
+ if ( error && error . status === 500 ) {
22
+ return < ErrorPage statusCode = { 500 } /> ;
23
+ }
24
+
18
25
return (
19
26
< AppLayout >
20
27
< div className = "sticky top-0 z-50 bg-white p-4 pb-0 dark:bg-gray-900 sm:mx-4 sm:pt-8" >
You can’t perform that action at this time.
0 commit comments