|
1 | 1 | "use client";
|
2 |
| - |
3 |
| -import { ArrowLeftIcon, CaretSortIcon, CopyIcon } from "@radix-ui/react-icons"; |
4 |
| -import { Button } from "~/components/ui/button"; |
5 |
| - |
6 |
| -import { |
7 |
| - Collapsible, |
8 |
| - CollapsibleContent, |
9 |
| - CollapsibleTrigger, |
10 |
| -} from "~/components/ui/collapsible"; |
11 | 2 | import React from "react";
|
12 |
| -import { Label } from "~/components/ui/label"; |
13 | 3 | import Link from "next/link";
|
14 |
| - |
15 |
| - |
16 |
| - |
| 4 | +import { Badge } from "~/components/ui/badge"; |
17 | 5 |
|
18 | 6 | export default function Index() {
|
19 |
| - const [isOpen, setIsOpen] = React.useState<number | null>(null); |
20 |
| - |
21 |
| - const handleCollapsibleOpen = (collapsibleIndex: number) => { |
22 |
| - setIsOpen((prevIndex) => |
23 |
| - prevIndex === collapsibleIndex ? null : collapsibleIndex |
24 |
| - ); |
25 |
| - }; |
26 |
| - |
27 |
| - |
| 7 | + const progetti = [ |
| 8 | + { |
| 9 | + name: "project-martina", |
| 10 | + url: "/projects/casellario-alfanumerico", |
| 11 | + description: "casellario alfanumerico", |
| 12 | + label: "WIP", |
| 13 | + }, |
| 14 | + { |
| 15 | + name: "project-arianna", |
| 16 | + url: "/projects/paroliere", |
| 17 | + description: "paroliere", |
| 18 | + label: "WIP", |
| 19 | + }, |
| 20 | + { |
| 21 | + name: "project-martina", |
| 22 | + url: "/projects/casellario_10", |
| 23 | + description: "Casellario alfanumerico 10x10", |
| 24 | + label: "WIP", |
| 25 | + }, |
| 26 | + { |
| 27 | + name: "project-puddu", |
| 28 | + url: "/projects/test", |
| 29 | + description: "Test Landigpage fullbread.dev", |
| 30 | + label: "Done", |
| 31 | + }, |
| 32 | + ]; |
28 | 33 |
|
29 | 34 | return (
|
30 |
| - <div className="flex place-items-center min-h-svh"> |
31 |
| - <Link href="/" className="place-self-start absolute"> |
32 |
| - <Button className="p-2 m-2" size="icon"> |
33 |
| - <ArrowLeftIcon className=" size-12 " /> |
34 |
| - </Button> |
35 |
| - </Link> |
36 |
| - |
37 |
| - <div className="mx-auto min-w-fit border rounded-lg p-5s"> |
38 |
| - <Collapsible |
39 |
| - open={isOpen === 1} |
40 |
| - onOpenChange={() => handleCollapsibleOpen(1)} |
41 |
| - className="w-[350px] space-y-2" |
42 |
| - > |
43 |
| - <div className="flex items-center justify-between space-x-4 px-4"> |
44 |
| - <h4 className="text-sm font-semibold">project-martina</h4> |
45 |
| - <CollapsibleTrigger asChild> |
46 |
| - <Button variant="ghost" size="sm"> |
47 |
| - <CaretSortIcon className="h-4 w-4" /> |
48 |
| - <span className="sr-only">Toggle</span> |
49 |
| - </Button> |
50 |
| - </CollapsibleTrigger> |
51 |
| - </div> |
52 |
| - <CollapsibleContent className="space-y-2"> |
53 |
| - <div className="flex rounded-md border px-4 py-2 font-mono text-sm shadow-sm "> |
54 |
| - <Link className="p-2" href={"/projects/casellario-alfanumerico"}><Button>1x3x3</Button></Link> |
55 |
| - <Link className="p-2" href={"/projects/casellario_10"}><Button>10x3x3</Button></Link> |
56 |
| - </div> |
57 |
| - </CollapsibleContent> |
58 |
| - </Collapsible> |
59 |
| - <Collapsible |
60 |
| - open={isOpen === 2} |
61 |
| - onOpenChange={() => handleCollapsibleOpen(2)} |
62 |
| - className="w-[350px] space-y-2" |
63 |
| - > |
64 |
| - <div className="flex items-center justify-between space-x-4 px-4"> |
65 |
| - <h4 className="text-sm font-semibold">project-arianna</h4> |
66 |
| - <CollapsibleTrigger asChild> |
67 |
| - <Button variant="ghost" size="sm"> |
68 |
| - <CaretSortIcon className="h-4 w-4" /> |
69 |
| - <span className="sr-only">Toggle</span> |
70 |
| - </Button> |
71 |
| - </CollapsibleTrigger> |
72 |
| - </div> |
73 |
| - <CollapsibleContent className="space-y-2"> |
74 |
| - <div className="flex items-center justify-between rounded-md border px-4 py-2 font-mono text-sm shadow-sm "> |
75 |
| - <Link className="p-2" href={"/projects/paroliere"}><Button>test-paroliere-wip</Button></Link> |
76 |
| - <Label>work in progress</Label> |
| 35 | + <div className="flex min-h-dvh items-center justify-center p-4"> |
| 36 | + <div className="grid w-full max-w-6xl grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4"> |
| 37 | + {progetti.map((progetto) => ( |
| 38 | + <Link key={progetto.name} href={progetto.url} className="group"> |
| 39 | + <div className="flex flex-col overflow-hidden rounded-lg border"> |
| 40 | + <div className="flex flex-col p-6"> |
| 41 | + <div className="flex items-center justify-between"> |
| 42 | + <h4 className="text-xl font-semibold">{progetto.name}</h4> |
| 43 | + </div> |
| 44 | + <p className="mt-2 text-sm text-gray-600"> |
| 45 | + {progetto.description} |
| 46 | + </p> |
| 47 | + <div className="mt-4 flex justify-end"> |
| 48 | + <Badge className="px-2 py-1 text-xs">{progetto.label}</Badge> |
| 49 | + </div> |
| 50 | + </div> |
77 | 51 | </div>
|
78 |
| - </CollapsibleContent> |
79 |
| - </Collapsible> |
| 52 | + </Link> |
| 53 | + ))} |
80 | 54 | </div>
|
81 | 55 | </div>
|
82 | 56 | );
|
|
0 commit comments