diff --git a/src/pages/dashboard.tsx b/src/pages/dashboard.tsx index d6944bcb5..cb403be9d 100644 --- a/src/pages/dashboard.tsx +++ b/src/pages/dashboard.tsx @@ -4,7 +4,7 @@ import { useAxios } from "@/hooks/use-axios" import Header from "@/components/Header" import Footer from "@/components/Footer" import { Package } from "fake-snippets-api/lib/db/schema" -import { Edit2, KeyRound } from "lucide-react" +import { Edit2, KeyRound, Package2, Plus, Sparkles } from "lucide-react" import { Button } from "@/components/ui/button" import { useGlobalStore } from "@/hooks/use-global-store" import { Link } from "wouter" @@ -35,7 +35,6 @@ export const DashboardPage = () => { const { data: myPackages, isLoading, - error, refetch: refetchUserPackages, } = useQuery( ["userPackages", currentUser], @@ -87,8 +86,6 @@ export const DashboardPage = () => { }, ) - const baseUrl = useApiBaseUrl() - const handleDeleteClick = (e: React.MouseEvent, pkg: Package) => { e.preventDefault() // Prevent navigation setPackageToDelete(pkg) @@ -101,13 +98,13 @@ export const DashboardPage = () => {
-
+

Dashboard

{!isLoggedIn ? ( -
+
@@ -118,20 +115,20 @@ export const DashboardPage = () => {

Log in to access your dashboard and manage your packages.

-
) : ( <> -
-
-

- Edit Recent -

-
- {myPackages && - myPackages.slice(0, 3).map((pkg) => ( + {myPackages && myPackages.length > 0 && ( +
+
+

+ Edit Recent +

+
+ {myPackages.slice(0, 3).map((pkg) => (
{
))} +
-
- {/* */} -

- Your Recent Packages -

- {isLoading && ( -
- {[...Array(6)].map((_, i) => ( - - ))} -
- )} - {myPackages && myPackages.length > 0 ? ( -
- {myPackages.slice(0, 10).map((pkg) => ( - - ))} -
- ) : ( - !isLoading && - myPackages?.length === 0 && ( - - No packages found - - ) )} + +
+ {myPackages && myPackages.length > 0 && ( +

+ Your Recent Packages +

+ )} + + {isLoading && ( +
+ {[...Array(6)].map((_, i) => ( + + ))} +
+ )} + + {myPackages && myPackages.length > 0 ? ( +
+ {myPackages.slice(0, 10).map((pkg) => ( + + ))} +
+ ) : ( + !isLoading && + myPackages?.length === 0 && ( +
+
+
+ +
+

+ No packages yet +

+

+ Create your first package to get started with + tscircuit. Build and share electronic circuits with + ease. +

+
+ + + +
+
+
+ ) + )} +
{myPackages && myPackages.length > 10 && ( - - View all packages - +
+ + View all packages + +
)} {/* Organizations Section */} {organizations && organizations.length > 0 && ( -
-

+
+

Your Organizations

@@ -210,12 +236,14 @@ export const DashboardPage = () => { ))}
{organizations && organizations.length > 4 && ( - - View all organizations - +
+ + View all organizations + +
)}
)}