Skip to content

Commit 4dba610

Browse files
committed
Aggiornamento componenti UI e configurazione: migrazione a New York style, pulizia componenti e aggiornamento dipendenze
1 parent e83e210 commit 4dba610

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+969
-4715
lines changed

components.json

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
{
22
"$schema": "https://ui.shadcn.com/schema.json",
3-
"style": "default",
3+
"style": "new-york",
44
"rsc": true,
55
"tsx": true,
66
"tailwind": {
77
"config": "tailwind.config.ts",
88
"css": "src/styles/globals.css",
9-
"baseColor": "slate",
9+
"baseColor": "neutral",
1010
"cssVariables": true,
1111
"prefix": ""
1212
},
1313
"aliases": {
1414
"components": "~/components",
15-
"utils": "~/lib/utils"
16-
}
15+
"utils": "~/lib/utils",
16+
"ui": "~/components/ui",
17+
"lib": "~/lib",
18+
"hooks": "~/hooks"
19+
},
20+
"iconLibrary": "lucide"
1721
}

package-lock.json

+10-19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"@radix-ui/react-toggle-group": "^1.1.0",
4141
"@radix-ui/react-tooltip": "^1.1.2",
4242
"@t3-oss/env-nextjs": "^0.10.1",
43-
"class-variance-authority": "^0.7.0",
43+
"class-variance-authority": "^0.7.1",
4444
"clsx": "^2.1.1",
4545
"cmdk": "^1.0.0",
4646
"date-fns": "^3.6.0",
@@ -60,7 +60,7 @@
6060
"react-resizable-panels": "^2.1.0",
6161
"recharts": "^2.13.0-alpha.4",
6262
"sonner": "^1.5.0",
63-
"tailwind-merge": "^2.5.2",
63+
"tailwind-merge": "^2.6.0",
6464
"tailwindcss-animate": "^1.0.7",
6565
"vaul": "^0.9.1",
6666
"zod": "^3.23.8"

src/app/ig/page.tsx

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
'use client'
2+
3+
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "~/components/ui/card"
4+
import { Button } from "~/components/ui/button"
5+
import Link from "next/link"
6+
7+
const features = [
8+
{
9+
title: "Richieste di Follow in Sospeso",
10+
description: "Visualizza e gestisci le richieste di follow inviate su Instagram",
11+
link: "/ig/pending",
12+
icon: "📨"
13+
},
14+
{
15+
title: "Following",
16+
description: "Elenco delle persone che segui su Instagram",
17+
link: "/ig/following",
18+
icon: "👥"
19+
},
20+
{
21+
title: "Followers",
22+
description: "Elenco delle persone che ti seguono su Instagram",
23+
link: "/ig/followers",
24+
icon: "🫂"
25+
},
26+
{
27+
title: "Analisi Interazioni",
28+
description: "Analizza le interazioni con i tuoi contenuti",
29+
link: "/ig/interactions",
30+
icon: "📊"
31+
}
32+
]
33+
34+
export default function Page() {
35+
return (
36+
<div className="container mx-auto py-8">
37+
<div className="mb-8 text-center">
38+
<h1 className="text-4xl font-bold mb-4">Instagram Data Explorer</h1>
39+
<p className="text-xl text-gray-600">Esplora e analizza i tuoi dati Instagram</p>
40+
</div>
41+
42+
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
43+
{features.map((feature, index) => (
44+
<Card key={index} className="hover:shadow-lg transition-shadow duration-300">
45+
<Link href={feature.link} className="block h-full">
46+
<CardHeader>
47+
<div className="flex items-center gap-3">
48+
<span className="text-3xl">{feature.icon}</span>
49+
<CardTitle>{feature.title}</CardTitle>
50+
</div>
51+
<CardDescription>{feature.description}</CardDescription>
52+
</CardHeader>
53+
<CardContent>
54+
<Button variant="ghost" className="w-full">
55+
Esplora {feature.title}
56+
</Button>
57+
</CardContent>
58+
</Link>
59+
</Card>
60+
))}
61+
</div>
62+
</div>
63+
)
64+
}

src/app/ig/pending/page.tsx

+91
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
'use client'
2+
3+
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "~/components/ui/card"
4+
5+
import Link from "next/link"
6+
import { useState } from "react"
7+
import { Button } from "~/components/ui/button";
8+
9+
interface FollowRequest {
10+
title: string;
11+
media_list_data: any[];
12+
string_list_data: {
13+
href: string;
14+
value: string;
15+
timestamp: number;
16+
}[];
17+
}
18+
19+
export default function Page() {
20+
const [requests, setRequests] = useState<FollowRequest[]>([]);
21+
const [isLoading, setIsLoading] = useState(false);
22+
23+
const handleFileUpload = async (event: React.ChangeEvent<HTMLInputElement>) => {
24+
if (!event.target.files?.[0]) return;
25+
setIsLoading(true);
26+
27+
try {
28+
const file = event.target.files[0];
29+
const json = await file.text();
30+
const data = JSON.parse(json);
31+
setRequests(data.relationships_follow_requests_sent || []);
32+
} catch (error) {
33+
console.error('Errore nel caricamento del file:', error);
34+
} finally {
35+
setIsLoading(false);
36+
}
37+
};
38+
39+
return (
40+
<div className="container mx-auto py-8">
41+
<Card>
42+
<CardHeader>
43+
<CardTitle>Richieste di Follow in Sospeso</CardTitle>
44+
<CardDescription>Carica il tuo file JSON per vedere le richieste di follow inviate</CardDescription>
45+
</CardHeader>
46+
<CardContent>
47+
<div className="mb-6">
48+
<input
49+
type="file"
50+
accept=".json"
51+
onChange={handleFileUpload}
52+
className="block w-full text-sm text-slate-500
53+
file:mr-4 file:py-2 file:px-4
54+
file:rounded-full file:border-0
55+
file:text-sm file:font-semibold
56+
file:bg-violet-50 file:text-violet-700
57+
hover:file:bg-violet-100"
58+
/>
59+
</div>
60+
61+
<div className="grid gap-4">
62+
{requests.map((request, index) => (
63+
<Card key={index}>
64+
<CardContent className="p-4">
65+
<div className="flex items-center justify-between">
66+
<div>
67+
<p className="font-medium">
68+
{request.string_list_data[0]?.value || 'Utente sconosciuto'}
69+
</p>
70+
<p className="text-sm text-gray-500">
71+
{request.string_list_data[0]?.timestamp
72+
? new Date(request.string_list_data[0].timestamp * 1000).toLocaleDateString()
73+
: 'Data non disponibile'
74+
}
75+
</p>
76+
</div>
77+
<Button asChild variant="link">
78+
<Link href={request.string_list_data[0]?.href || '#'} target="_blank">
79+
Visualizza Profilo
80+
</Link>
81+
</Button>
82+
</div>
83+
</CardContent>
84+
</Card>
85+
))}
86+
</div>
87+
</CardContent>
88+
</Card>
89+
</div>
90+
);
91+
}

0 commit comments

Comments
 (0)