diff --git a/.vscode/settings.json b/.vscode/settings.json index de9e817..0a66f19 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,26 +1,31 @@ { - "eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact"], - "sort-imports.default-sort-style": "module-scoped", - "js/ts.implicitProjectConfig.checkJs": true, - "typescript.tsdk": "node_modules\\typescript\\lib", - "[javascript]": { - "editor.defaultFormatter": "esbenp.prettier-vscode", - "editor.formatOnSave": true - }, - "[javascriptreact]": { - "editor.defaultFormatter": "esbenp.prettier-vscode", - "editor.formatOnSave": true - }, - "[typescript]": { - "editor.defaultFormatter": "esbenp.prettier-vscode", - "editor.formatOnSave": true - }, - "[typescriptreact]": { - "editor.defaultFormatter": "esbenp.prettier-vscode", - "editor.formatOnSave": true - }, - "dart.debugExternalPackageLibraries": true, - "dart.debugSdkLibraries": true, - "git.autoRepositoryDetection": "subFolders", - "postman.settings.dotenv-detection-notification-visibility": false -} \ No newline at end of file + "eslint.validate": [ + "javascript", + "javascriptreact", + "typescript", + "typescriptreact" + ], + "sort-imports.default-sort-style": "module-scoped", + "js/ts.implicitProjectConfig.checkJs": true, + "typescript.tsdk": "node_modules\\typescript\\lib", + "[javascript]": { + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.formatOnSave": true + }, + "[javascriptreact]": { + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.formatOnSave": true + }, + "[typescript]": { + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.formatOnSave": true + }, + "[typescriptreact]": { + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.formatOnSave": true + }, + "dart.debugExternalPackageLibraries": true, + "dart.debugSdkLibraries": true, + "git.autoRepositoryDetection": "subFolders", + "postman.settings.dotenv-detection-notification-visibility": false +} diff --git a/src/app/(root)/dashboard/[fileid]/page.tsx b/src/app/(root)/dashboard/[fileid]/page.tsx index cf2c399..949ccdb 100644 --- a/src/app/(root)/dashboard/[fileid]/page.tsx +++ b/src/app/(root)/dashboard/[fileid]/page.tsx @@ -47,11 +47,11 @@ const Page = async ({ params }: PageProps) => { ); return ( -
-
+
+
{/* PDF Column */}
-
+
diff --git a/src/app/(root)/dashboard/page.tsx b/src/app/(root)/dashboard/page.tsx index f2bef28..fb36150 100644 --- a/src/app/(root)/dashboard/page.tsx +++ b/src/app/(root)/dashboard/page.tsx @@ -3,8 +3,8 @@ import UploadButton from '@/components/UploadButton'; const Dashboard = () => { return ( -
-
+
+

My Files

diff --git a/src/app/(root)/layout.tsx b/src/app/(root)/layout.tsx index ce96d44..a4d8ae3 100644 --- a/src/app/(root)/layout.tsx +++ b/src/app/(root)/layout.tsx @@ -7,7 +7,7 @@ export default function RootLayout({ children: React.ReactNode; }) { return ( -
+
{children}
diff --git a/src/components/MaxWidthWrapper.tsx b/src/components/MaxWidthWrapper.tsx deleted file mode 100644 index 390d137..0000000 --- a/src/components/MaxWidthWrapper.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import { ReactNode } from 'react'; - -import { cn } from '@/lib/utils'; - -const MaxWidthWrapper = ({ - className, - children, -}: { - className?: string; - children: ReactNode; -}) => { - return ( -
- {children} -
- ); -}; - -export default MaxWidthWrapper; diff --git a/src/components/MobileNav.tsx b/src/components/MobileNav.tsx deleted file mode 100644 index d41442f..0000000 --- a/src/components/MobileNav.tsx +++ /dev/null @@ -1,97 +0,0 @@ -'use client'; - -import { ArrowRight, Menu } from 'lucide-react'; -import Link from 'next/link'; -import { usePathname } from 'next/navigation'; -import { useEffect, useState } from 'react'; - -const MobileNav = ({ isAuth }: { isAuth: boolean }) => { - const [isOpen, setOpen] = useState(false); - - const toggleOpen = () => setOpen((prev) => !prev); - - const pathname = usePathname(); - - useEffect(() => { - if (isOpen) toggleOpen(); - }, [pathname, isOpen]); - - const closeOnCurrent = (href: string) => { - if (pathname === href) { - toggleOpen(); - } - }; - - return ( -
- - - {isOpen ? ( -
-
    - {!isAuth ? ( - <> -
  • - closeOnCurrent('/sign-up')} - className="flex items-center w-full font-semibold text-green-600" - href="/sign-up" - > - Get started - - -
  • -
  • -
  • - closeOnCurrent('/sign-in')} - className="flex items-center w-full font-semibold" - href="/sign-in" - > - Sign in - -
  • -
  • -
  • - closeOnCurrent('/pricing')} - className="flex items-center w-full font-semibold" - href="/pricing" - > - Pricing - -
  • - - ) : ( - <> -
  • - closeOnCurrent('/dashboard')} - className="flex items-center w-full font-semibold" - href="/dashboard" - > - Dashboard - -
  • -
  • -
  • - - Sign out - -
  • - - )} -
-
- ) : null} -
- ); -}; - -export default MobileNav; diff --git a/src/components/Navbar.tsx b/src/components/Navbar.tsx index 587243a..2a4b038 100644 --- a/src/components/Navbar.tsx +++ b/src/components/Navbar.tsx @@ -1,69 +1,28 @@ 'use client'; -import { - SignedIn, - SignedOut, - SignInButton, - UserButton, - useUser, -} from '@clerk/nextjs'; -import { ArrowRight } from 'lucide-react'; +import { SignedIn, UserButton, SignedOut } from '@clerk/nextjs'; import Link from 'next/link'; -import MaxWidthWrapper from './MaxWidthWrapper'; -import MobileNav from './MobileNav'; -import { Button, buttonVariants } from './ui/button'; -import { Skeleton } from './ui/skeleton'; +import { Button } from './ui/button'; const Navbar = () => { - const { user, isLoaded } = useUser(); - return ( - ); }; diff --git a/src/components/PostHogProvider.tsx b/src/components/PostHogProvider.tsx index 47728ce..89b92d0 100644 --- a/src/components/PostHogProvider.tsx +++ b/src/components/PostHogProvider.tsx @@ -1,29 +1,17 @@ +// app/providers.tsx 'use client'; -import posthogClient from 'posthog-js'; +import { posthog as posthogjs } from 'posthog-js'; import { PostHogProvider as PHProvider } from 'posthog-js/react'; import { useEffect } from 'react'; export function PostHogProvider({ children }: { children: React.ReactNode }) { - const isProd = process.env.NODE_ENV === 'production'; useEffect(() => { - const key = process.env.NEXT_PUBLIC_POSTHOG_KEY; - - if (!isProd) { - posthogClient.opt_out_capturing?.(); - return; - } - - if (!key) return; - - posthogClient.init(key, { - api_host: '/ingest', - ui_host: 'https://us.posthog.com', - capture_exceptions: true, // Enable PostHog error tracking - debug: false, + posthogjs.init(process.env.NEXT_PUBLIC_POSTHOG_KEY!, { + api_host: process.env.NEXT_PUBLIC_POSTHOG_HOST, + defaults: '2025-05-24', }); - }, [isProd]); + }, []); - if (!isProd) return <>{children}; - return {children}; + return {children}; } diff --git a/src/components/chat/ChatComponent.tsx b/src/components/chat/ChatComponent.tsx index f395035..9955eda 100644 --- a/src/components/chat/ChatComponent.tsx +++ b/src/components/chat/ChatComponent.tsx @@ -20,7 +20,7 @@ import { Button, buttonVariants } from '../ui/button'; import { Textarea } from '../ui/textarea'; import SelectLanguage from './SelectLanguage'; -import MessageItem from './messages/MessageItem'; +import { MessageItem } from './messages'; const ChatComponent = ({ file }: { file: File }) => { const [input, setInput] = useState(''); @@ -60,8 +60,8 @@ const ChatComponent = ({ file }: { file: File }) => { }), { getNextPageParam: (lastPage) => lastPage.cursor, - staleTime: 60 * 1000, - cacheTime: 5 * 60 * 1000, + staleTime: Infinity, + cacheTime: Infinity, } ); @@ -232,6 +232,12 @@ const ChatComponent = ({ file }: { file: File }) => {