diff --git a/src/pages/quickstart.tsx b/src/pages/quickstart.tsx index d543c31..ebf653b 100644 --- a/src/pages/quickstart.tsx +++ b/src/pages/quickstart.tsx @@ -1,41 +1,41 @@ -import React, { useState } from "react" -import { useQuery } from "react-query" -import { useAxios } from "@/hooks/use-axios" -import Header from "@/components/Header" -import Footer from "@/components/Footer" -import { Snippet } from "fake-snippets-api/lib/db/schema" -import { Link } from "wouter" -import { Button } from "@/components/ui/button" -import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card" -import { TypeBadge } from "@/components/TypeBadge" -import { JLCPCBImportDialog } from "@/components/JLCPCBImportDialog" -import { useNotImplementedToast } from "@/hooks/use-toast" -import { useGlobalStore } from "@/hooks/use-global-store" -import { cn } from "@/lib/utils" +import React, { useState } from "react"; +import { useQuery } from "react-query"; +import { useAxios } from "@/hooks/use-axios"; +import Header from "@/components/Header"; +import Footer from "@/components/Footer"; +import { Snippet } from "fake-snippets-api/lib/db/schema"; +import { Link } from "wouter"; +import { Button } from "@/components/ui/button"; +import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; +import { TypeBadge } from "@/components/TypeBadge"; +import { JLCPCBImportDialog } from "@/components/JLCPCBImportDialog"; +import { useNotImplementedToast } from "@/hooks/use-toast"; +import { useGlobalStore } from "@/hooks/use-global-store"; +import { cn } from "@/lib/utils"; export const QuickstartPage = () => { - const axios = useAxios() - const [isJLCPCBDialogOpen, setIsJLCPCBDialogOpen] = useState(false) - const toastNotImplemented = useNotImplementedToast() - const currentUser = useGlobalStore((s) => s.session?.github_username) + const axios = useAxios(); + const [isJLCPCBDialogOpen, setIsJLCPCBDialogOpen] = useState(false); + const toastNotImplemented = useNotImplementedToast(); + const currentUser = useGlobalStore((s) => s.session?.github_username); const { data: mySnippets, isLoading } = useQuery( "userSnippets", async () => { const response = await axios.get( - `/snippets/list?owner_name=${currentUser}`, - ) - return response.data.snippets - }, - ) + `/snippets/list?owner_name=${currentUser}` + ); + return response.data.snippets; + } + ); const blankTemplates = [ { name: "Blank Circuit Board", type: "board" }, { name: "Blank Circuit Module", type: "package" }, { name: "Blank 3D Model", type: "model", disabled: true }, { name: "Blank Footprint", type: "footprint", disabled: true }, - ] + ]; - const templates = [{ name: "Blinking LED Board", type: "board" }] + const templates = [{ name: "Blinking LED Board", type: "board" }]; return (
@@ -46,7 +46,7 @@ export const QuickstartPage = () => { {isLoading ? (
Loading...
) : ( -
+
{mySnippets?.slice(0, 6).map((snippet) => ( {

Start Blank Snippet

-
+
{blankTemplates.map((template, index) => ( @@ -103,7 +105,7 @@ export const QuickstartPage = () => {

Import as Snippet

-
+
{[ { name: "KiCad Footprint", type: "footprint" }, { name: "KiCad Project", type: "board" }, @@ -123,7 +125,7 @@ export const QuickstartPage = () => {