diff --git a/.gitignore b/.gitignore
index 1bb472b..d6336f3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -26,4 +26,7 @@ dist-ssr
# Media files
*.webp
*.mp4
-*.jpg
\ No newline at end of file
+*.jpg
+
+
+.env
\ No newline at end of file
diff --git a/index.html b/index.html
index b6dbc9a..bbfe3c5 100644
--- a/index.html
+++ b/index.html
@@ -9,6 +9,10 @@
href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap"
rel="stylesheet"
/>
+
diff --git a/src/components/FacebookCarousel.tsx b/src/components/FacebookCarousel.tsx
index 7467dde..25a966f 100644
--- a/src/components/FacebookCarousel.tsx
+++ b/src/components/FacebookCarousel.tsx
@@ -1,76 +1,218 @@
-import { useState } from "react";
+import { useState, useEffect } from "react";
import { motion, AnimatePresence } from "framer-motion";
// Modèle de données pour un post Facebook
interface FacebookPost {
- id: number;
+ id: number | string;
date: string;
content: string;
imageSrc: string;
link: string;
}
-// Fausses données (en attendant la connexion API ou le widget)
-const mockPosts: FacebookPost[] = [
- {
- id: 1,
- date: "Il y a 2 jours",
- content:
- "Un immense merci aux bénévoles présents ce matin pour la préparation des 50 nouveaux colis à destination de l'Ukraine ! 🌻📦",
- imageSrc: "/historique/pam-aerien.webp", // Mets une vraie image de test
- link: "https://www.facebook.com",
- },
- {
- id: 2,
- date: "La semaine dernière",
- content:
- "Retour en images sur notre superbe atelier de peinture traditionnelle de Pâques (Pysanka). Merci aux enfants pour leur créativité ! 🎨",
- imageSrc: "/historique/premier-evenement.webp",
- link: "https://www.facebook.com",
- },
- {
- id: 3,
- date: "Il y a 2 semaines",
- content:
- "Le camion est bien arrivé ! La génératrice a pu être livrée à l'hôpital de Kharkiv. Merci à tous nos donateurs. 💙💛",
- imageSrc: "/historique/dernier-evenement.webp",
- link: "https://www.facebook.com",
- },
- {
- id: 4,
- date: "Il y a 3 semaines",
- content:
- "Réunion très productive avec la mairie pour préparer l'année à venir. De beaux projets en perspective ! 🏛️🤝",
- imageSrc: "/historique/signature-statuts.webp",
- link: "https://www.facebook.com",
- },
- {
- id: 5,
- date: "Il y a 1 mois",
- content:
- "Collecte de vêtements chauds terminée. Merci à tous les donateurs, le camion part demain ! 🚛❄️",
- imageSrc: "/historique/arrivee.webp",
- link: "https://www.facebook.com",
- },
- {
- id: 6,
- date: "Il y a 1 mois",
- content:
- "Petit souvenir de notre stand au forum des associations. On a hâte de vous retrouver ! 👋",
- imageSrc: "/hero-section/a-propos.webp",
- link: "https://www.facebook.com",
- },
-];
+// Interface pour la réponse de l'API Facebook
+interface FacebookApiPost {
+ id: string;
+ created_time: string;
+ message?: string;
+ full_picture?: string;
+ permalink_url: string;
+ attachments?: {
+ data: Array<{
+ title?: string;
+ media?: {
+ image?: { src: string };
+ };
+ }>;
+ };
+}
+
+// Interface pour la récupération des comptes (pages)
+interface FacebookAccountResponse {
+ data: Array<{
+ id: string;
+ access_token: string;
+ }>;
+}
+
+// Composant Spinner
+const LoadingSpinner = () => (
+
+
+
+);
+
+const ErrorMessage = () => (
+
+
+ Suivez nos dernières actions directement sur Facebook.
+