Skip to content

Commit

Permalink
It works! Doesn't look good and is slow, but it works!
Browse files Browse the repository at this point in the history
  • Loading branch information
aamirazad committed Jun 27, 2024
1 parent 8e6c0ba commit 9ecff2f
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 123 deletions.
Binary file modified bun.lockb
Binary file not shown.
17 changes: 0 additions & 17 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,6 @@ const config = {
},
],
},
webpack: (config, { isServer }) => {
if (!isServer) {
config.resolve.fallback.fs = false;
}

return config;
},
experimental: {
turbo: {
rules: {
"*.svg": {
loaders: ["@svgr/webpack"],
as: "*.js",
},
},
},
},
};

export default config;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"db:migrate": "drizzle-kit migrate",
"db:push": "drizzle-kit push",
"db:studio": "drizzle-kit studio",
"dev": "next dev --turbo",
"dev": "next dev",
"lint": "next lint",
"start": "next start"
},
Expand Down
9 changes: 2 additions & 7 deletions src/app/@modal/(.)paperless/document/[id]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import { Modal } from "./modal";
import DocumentViewer from "@/components/document-viewer";

export default function DocumentModal(props: { id: number }) {
return (
<Modal>
<DocumentViewer id={props.id}></DocumentViewer>
</Modal>
);
export default function FullPageDocumentPage({ params }: { params: { id: number } }) {
return <DocumentViewer id={params.id} />;
}
1 change: 1 addition & 0 deletions src/app/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,5 @@ export async function getPaperlessDocument(id: number) {
}
} catch (error) {
console.error("Error fetching PDF:", error);
}
}
40 changes: 0 additions & 40 deletions src/app/document-testing/page.tsx

This file was deleted.

53 changes: 0 additions & 53 deletions src/app/document-testing/something.tsx

This file was deleted.

7 changes: 3 additions & 4 deletions src/app/paperless/document/[id]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import DocumentViewer from "@/components/document-viewer";

export default function FullPageDocumentPage(props: { id: number }) {
return (
<DocumentViewer id={props.id} />
);
export default function FullPageDocumentPage({ params }: { params: { id: number } }) {
console.log("FULLL PAPGJPIGHEGPIUSHEGPIUWEGHPIWUEGH: " + params.id);
return <DocumentViewer id={params.id} />;
}
2 changes: 1 addition & 1 deletion src/components/document-viewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import LoadingSpinner from "@/components/loading-spinner";
export default function DocumentViewer(props: { id: number }) {
const [pdfUrl, setPdfUrl] = useState<string | null>(null);
const [loading, setLoading] = useState(true);
console.log("docuement viewer: " + props.id)

useEffect(() => {
const fetchData = async () => {
Expand All @@ -21,7 +22,6 @@ export default function DocumentViewer(props: { id: number }) {
try {
const response = await fetch(url, {
headers: {
"Content-Type": "application/pdf",
Authorization: `Token ${userData.paperlessToken}`,
},
});
Expand Down

0 comments on commit 9ecff2f

Please sign in to comment.