diff --git a/app/dashboard/adherents/page.tsx b/app/dashboard/adherents/page.tsx index 0fa8b24..08aea55 100644 --- a/app/dashboard/adherents/page.tsx +++ b/app/dashboard/adherents/page.tsx @@ -18,11 +18,11 @@ export default async function AdherentsPage() { return ( -
-

+
+

Adhérents

-

+

Base de données des adhérents

diff --git a/app/dashboard/archives/page.tsx b/app/dashboard/archives/page.tsx index 850fb9e..5698c26 100644 --- a/app/dashboard/archives/page.tsx +++ b/app/dashboard/archives/page.tsx @@ -17,9 +17,9 @@ export default async function ArchivesPage() { return ( -
-

Archives

-

Trajets archivés

+
+

Archives

+

Trajets archivés

diff --git a/app/dashboard/calendrier/page.tsx b/app/dashboard/calendrier/page.tsx index c60fde8..46f8bda 100644 --- a/app/dashboard/calendrier/page.tsx +++ b/app/dashboard/calendrier/page.tsx @@ -18,11 +18,11 @@ export default async function CalendrierPage() { return ( -
-

+
+

Calendrier

-

+

Gestion des trajets et planning des chauffeurs

diff --git a/app/dashboard/chauffeurs/page.tsx b/app/dashboard/chauffeurs/page.tsx index 92be56d..4a50d61 100644 --- a/app/dashboard/chauffeurs/page.tsx +++ b/app/dashboard/chauffeurs/page.tsx @@ -18,11 +18,11 @@ export default async function ChauffeursPage() { return ( -
-

+
+

Chauffeurs

-

+

Base de données des chauffeurs

diff --git a/app/dashboard/univers-pro/page.tsx b/app/dashboard/univers-pro/page.tsx index ad19621..ca5ec44 100644 --- a/app/dashboard/univers-pro/page.tsx +++ b/app/dashboard/univers-pro/page.tsx @@ -18,11 +18,11 @@ export default async function UniversProPage() { return ( -
-

+
+

Univers Pro

-

+

Base de données des contacts professionnels

diff --git a/app/error.tsx b/app/error.tsx index 8c5bac8..1aa5be0 100644 --- a/app/error.tsx +++ b/app/error.tsx @@ -16,49 +16,50 @@ export default function Error({ error, reset }: ErrorProps) { }, [error]); return ( -
-
+
+
{/* Logo */} -
+
MAD Logo
{/* 500 Content */}
-

500

-

+

500

+

Erreur serveur

-

+

Une erreur inattendue s'est produite sur le serveur.

{error.message && ( -

+

{error.message}

)} {!error.message && ( -

+

Veuillez réessayer dans quelques instants.

)} {/* Action Buttons */} -
+
Retour au tableau de bord @@ -66,8 +67,8 @@ export default function Error({ error, reset }: ErrorProps) {
{/* Footer */} -
- © {new Date().getFullYear()} MAD - Propulsé par LGX +
+ © {new Date().getFullYear()} MAD - Propulsé par LGX
diff --git a/app/login/page.tsx b/app/login/page.tsx index cd190be..034f0f0 100644 --- a/app/login/page.tsx +++ b/app/login/page.tsx @@ -11,25 +11,26 @@ export default async function LoginPage() { } return ( -
-
+
+
{/* Logo */} -
+
MAD Logo
{/* Heading */} -
-

+
+

Content de vous revoir

-

+

Connectez-vous pour accéder à la plateforme.

@@ -38,7 +39,7 @@ export default async function LoginPage() { {/* Footer */} -
+
© {new Date().getFullYear()} MAD - Propulsé par LGX
diff --git a/app/not-found.tsx b/app/not-found.tsx index 33a5e86..46f0b7e 100644 --- a/app/not-found.tsx +++ b/app/not-found.tsx @@ -3,39 +3,40 @@ import Image from 'next/image'; export default function NotFound() { return ( -
-
+
+
{/* Logo */} -
+
MAD Logo
{/* 404 Content */}
-

404

-

+

404

+

Page non trouvée

-

+

Désolé, la page que vous recherchez n'existe pas ou a été déplacée.

{/* Action Buttons */} -
+
Retour au tableau de bord Page de connexion @@ -43,8 +44,8 @@ export default function NotFound() {
{/* Footer */} -
- © {new Date().getFullYear()} MAD - Propulsé par LGX +
+ © {new Date().getFullYear()} MAD - Propulsé par LGX
diff --git a/components/AdherentForm.tsx b/components/AdherentForm.tsx index 05b32c2..5c3171d 100644 --- a/components/AdherentForm.tsx +++ b/components/AdherentForm.tsx @@ -27,6 +27,7 @@ interface AdherentFormProps { export default function AdherentForm({ adherent, onClose }: AdherentFormProps) { const [loading, setLoading] = useState(false); + const [isMobile, setIsMobile] = useState(false); const [alertModal, setAlertModal] = useState<{ show: boolean; type: 'success' | 'error' | 'info' | 'warning'; @@ -64,6 +65,17 @@ export default function AdherentForm({ adherent, onClose }: AdherentFormProps) { fetchOptions(); }, []); + useEffect(() => { + const checkMobile = () => { + setIsMobile(window.innerWidth < 768); // md breakpoint + }; + + checkMobile(); + window.addEventListener('resize', checkMobile); + + return () => window.removeEventListener('resize', checkMobile); + }, []); + const fetchOptions = async () => { try { const response = await fetch('/api/settings/adherent-options'); @@ -153,6 +165,51 @@ export default function AdherentForm({ adherent, onClose }: AdherentFormProps) { } }; + // Si on est sur mobile, afficher un message au lieu du formulaire + if (isMobile) { + return ( +
+
+
+
+

+ {adherent ? 'Modifier l\'adhérent' : 'Nouvel adhérent'} +

+
+ +
+ +
+
+ + + +
+

+ Utilisez un ordinateur +

+

+ Pour {adherent ? 'modifier' : 'créer'} un adhérent, veuillez utiliser un ordinateur. Cette fonctionnalité n'est pas optimisée pour les appareils mobiles. +

+ +
+
+
+ ); + } + return (
diff --git a/components/AdherentsTable.tsx b/components/AdherentsTable.tsx index 0a324d5..954bd08 100644 --- a/components/AdherentsTable.tsx +++ b/components/AdherentsTable.tsx @@ -722,169 +722,281 @@ export default function AdherentsTable() {
{/* Boutons d'action */} -
+
- {/* Tableau */} + {/* Tableau - Desktop */}
{loading ? (
Chargement...
) : adherents.length === 0 ? (
Aucun adhérent trouvé
) : ( -
- - - - - - - - - - - - - - {adherents.map((adherent) => ( - - - - - - - - ))} - -
- 0 && selectedIds.size === adherents.length} - onChange={(e) => handleSelectAll(e.target.checked)} - className="w-4 h-4 text-lblue border-gray-300 rounded focus:ring-lblue" - /> - NOMCONTACTADRESSEPRESCRIPTEURSITUATIONACTIONS
+ <> + {/* Vue desktop - Tableau */} +
+ + + + + + + + + + + + + {adherents.map((adherent) => ( + + + - + + + + + + + ))} + +
handleSelectOne(adherent.id, e.target.checked)} + checked={adherents.length > 0 && selectedIds.size === adherents.length} + onChange={(e) => handleSelectAll(e.target.checked)} className="w-4 h-4 text-lblue border-gray-300 rounded focus:ring-lblue" /> - - -
-
- {getInitials(adherent.nom, adherent.prenom)} -
-
-
- {adherent.prenom} {adherent.nom} + +
NOMCONTACTADRESSEPRESCRIPTEURSITUATIONACTIONS
+ handleSelectOne(adherent.id, e.target.checked)} + className="w-4 h-4 text-lblue border-gray-300 rounded focus:ring-lblue" + /> + +
+
+ {getInitials(adherent.nom, adherent.prenom)}
-
- Né le {formatDate(adherent.dateNaissance)} +
+
+ {adherent.prenom} {adherent.nom} +
+
+ Né le {formatDate(adherent.dateNaissance)} +
-
-
-
- - - - {adherent.telephone} - (Principal) -
- {adherent.telephoneSecondaire && ( +
- {adherent.telephoneSecondaire} - (Secondaire) + {adherent.telephone} + (Principal) +
+ {adherent.telephoneSecondaire && ( +
+ + + + {adherent.telephoneSecondaire} + (Secondaire) +
+ )} +
+ + + + {adherent.email} +
+
+
{adherent.adresse}
+
+
+ {adherent.prescripteur || '-'} +
+
+
+ {adherent.situation || '-'} +
+
+
+ + + +
+
+
+ + {/* Vue mobile - Cartes */} +
+ {adherents.map((adherent) => ( +
+
+ {/* Checkbox */} + handleSelectOne(adherent.id, e.target.checked)} + className="w-4 h-4 text-lblue border-gray-300 rounded focus:ring-lblue mt-1" + /> + + {/* Avatar */} +
+ {getInitials(adherent.nom, adherent.prenom)} +
+ + {/* Contenu principal */} +
+ {/* Nom et date de naissance */} +
+
+ {adherent.prenom} {adherent.nom} +
+
+ Né le {formatDate(adherent.dateNaissance)}
- )} -
- - - - {adherent.email}
-
-
{adherent.adresse}
-
-
- {adherent.prescripteur || '-'} + + {/* Contact */} + -
-
- {adherent.situation || '-'} + + {/* Adresse */} +
+
Adresse
+
+ {adherent.adresse} +
-
-
+ + {/* Prescripteur et Situation */} +
+ {adherent.prescripteur && ( +
+
Prescripteur
+
{adherent.prescripteur}
+
+ )} + {adherent.situation && ( +
+
Situation
+
{adherent.situation}
+
+ )} +
+ + {/* Actions */} +
-
-
+
+
+
+ ))} +
+ )}
@@ -1134,29 +1246,29 @@ export default function AdherentsTable() { {/* Modal vue détaillée - Design épuré */} {viewingAdherent && ( -
-
+
+
{/* Header épuré */} -
+
-
-
+
+
{getInitials(viewingAdherent.nom, viewingAdherent.prenom)}
-
-

+
+

{viewingAdherent.prenom} {viewingAdherent.nom}

-

+

Informations détaillées de l'adhérent

@@ -1165,57 +1277,57 @@ export default function AdherentsTable() { {/* Contenu scrollable */}
-
+
{/* Actions rapides */} -
+ -
+
{/* Carte Informations principales */} -
-
-
- +
+
+
+
-

+

Informations principales

-
-
-
- +
+
+
+
@@ -1225,39 +1337,39 @@ export default function AdherentsTable() {
-
-
- + {viewingAdherent.telephoneSecondaire && ( -
-
- +
+
+
)} -
-
- +
+
+
@@ -1269,38 +1381,38 @@ export default function AdherentsTable() {
-
-
- +
+
+

Adresse

-

{viewingAdherent.adresse}

+

{viewingAdherent.adresse}

{/* Carte Informations complémentaires */} -
-
-
- +
+
+
+
-

+

Informations complémentaires

-
+
{viewingAdherent.situation && ( -
-
- +
+
+
@@ -1312,9 +1424,9 @@ export default function AdherentsTable() { )} {viewingAdherent.prescripteur && ( -
-
- +
+
+
@@ -1326,9 +1438,9 @@ export default function AdherentsTable() { )} {viewingAdherent.facturation && ( -
-
- +
+
+
@@ -1340,9 +1452,9 @@ export default function AdherentsTable() { )} {viewingAdherent.forfait && ( -
-
- +
+
+
@@ -1354,29 +1466,29 @@ export default function AdherentsTable() { )} {viewingAdherent.commentaire && ( -
-
- +
+
+

Commentaire

-

{viewingAdherent.commentaire}

+

{viewingAdherent.commentaire}

)} {viewingAdherent.instructions && ( -
-
- +
+
+

Instructions

-

{viewingAdherent.instructions}

+

{viewingAdherent.instructions}

)} @@ -1393,11 +1505,11 @@ export default function AdherentsTable() {
{/* Footer avec actions */} -
-
+
+
@@ -1406,9 +1518,9 @@ export default function AdherentsTable() { setViewingAdherent(null); handleEdit(viewingAdherent); }} - className="px-6 py-2.5 bg-lblue text-white text-sm font-semibold rounded-lg hover:bg-dblue transition-colors flex items-center gap-2" + className="px-4 md:px-6 py-2.5 bg-lblue text-white text-sm font-semibold rounded-lg hover:bg-dblue transition-colors flex items-center justify-center gap-2 w-full md:w-auto" > - + Modifier l'adhérent diff --git a/components/ArchivesTrajets.tsx b/components/ArchivesTrajets.tsx index f58dae2..85b592a 100644 --- a/components/ArchivesTrajets.tsx +++ b/components/ArchivesTrajets.tsx @@ -130,8 +130,8 @@ export default function ArchivesTrajets() { if (loading) { return ( -
-
Chargement des archives...
+
+
Chargement des archives...
); } @@ -139,18 +139,18 @@ export default function ArchivesTrajets() { return (
{/* Barre de recherche */} -
-
+
+
setSearchTerm(e.target.value)} - className="w-full px-4 py-2.5 pl-10 border border-gray-300 rounded-lg focus:ring-2 focus:ring-lblue focus:border-transparent" + className="w-full px-3 md:px-4 py-2 md:py-2.5 pl-9 md:pl-10 text-sm md:text-base border border-gray-300 rounded-lg focus:ring-2 focus:ring-lblue focus:border-transparent" /> {/* Liste des trajets archivés */} -
+
{filteredTrajets.length === 0 ? ( -
+
{searchTerm ? 'Aucun trajet trouvé' : 'Aucun trajet archivé'}
) : ( -
+
{filteredTrajets.map((trajet) => (
-
+
-
-
+
+
{getInitials(trajet.adherent.nom, trajet.adherent.prenom)}
-
-
+
+
{trajet.adherent.prenom} {trajet.adherent.nom}
-
+
{formatDate(trajet.date)} à {formatTime(trajet.date)}
- + {trajet.statut}
-
+
-
+
A
-
+
Départ
-
{trajet.adresseDepart}
+
{trajet.adresseDepart}
-
+
B
-
+
Arrivée
-
{trajet.adresseArrivee}
+
{trajet.adresseArrivee}
{trajet.chauffeur && ( -
- +
+ - Chauffeur: {trajet.chauffeur.prenom} {trajet.chauffeur.nom} + Chauffeur: {trajet.chauffeur.prenom} {trajet.chauffeur.nom}
)}
); } @@ -137,7 +137,7 @@ function DroppableDayCell({ @@ -404,15 +404,15 @@ export default function CalendrierTrajets({ refreshTrigger }: CalendrierTrajetsP
{loading ? ( -
Chargement...
+
Chargement...
) : ( <> {/* Grille du calendrier avec drag and drop */} -
+
{/* En-têtes des jours */} {days.map((day) => ( -
+
{day}
))} @@ -442,21 +442,21 @@ export default function CalendrierTrajets({ refreshTrigger }: CalendrierTrajetsP isSelected={isSelected} onDateClick={handleDateClick} > -
+
{date.getDate()}
{trajetsDuJour.length > 0 && ( -
- {trajetsDuJour.slice(0, 3).map((trajet) => ( +
+ {trajetsDuJour.slice(0, 2).map((trajet) => ( ))} - {trajetsDuJour.length > 3 && ( -
- +{trajetsDuJour.length - 3} + {trajetsDuJour.length > 2 && ( +
+ +{trajetsDuJour.length - 2}
)}
@@ -484,11 +484,11 @@ export default function CalendrierTrajets({ refreshTrigger }: CalendrierTrajetsP {/* Détails des trajets du jour sélectionné */} {selectedDate && selectedTrajets.length > 0 && ( -
-

+
+

Trajets du {formatDate(selectedDate)}

-
+
{selectedTrajets.map((trajet) => { const getStatutColor = (statut: string) => { switch (statut) { @@ -509,55 +509,55 @@ export default function CalendrierTrajets({ refreshTrigger }: CalendrierTrajetsP + )} +
+ {conversation.type === 'group' ? conversation.displayName.charAt(0).toUpperCase() : conversation.displayName @@ -302,8 +316,8 @@ export default function ChatWindow({ .slice(0, 2)}
-
-

{conversation.displayName}

+
+

{conversation.displayName}

{conversation.type === 'group' && (

{conversation.participants.length} participant{conversation.participants.length > 1 ? 's' : ''} @@ -314,7 +328,7 @@ export default function ChatWindow({ {conversation.type === 'group' && (

{/* Messages */} -
+
{error && (
Erreur lors du chargement des messages @@ -348,7 +362,7 @@ export default function ChatWindow({ className={`flex ${isOwnMessage ? 'justify-end' : 'justify-start'}`} >
{/* Zone de saisie */} -
+
{/* Fichiers sélectionnés */} {files.length > 0 && (
{files.map((file, index) => (
- {file.name} + {file.name} +
+ +
+
+ + + +
+

+ Utilisez un ordinateur +

+

+ Pour {chauffeur ? 'modifier' : 'créer'} un chauffeur, veuillez utiliser un ordinateur. Cette fonctionnalité n'est pas optimisée pour les appareils mobiles. +

+ +
+
+
+ ); + } + return (
diff --git a/components/ChauffeursTable.tsx b/components/ChauffeursTable.tsx index 8133984..596cc96 100644 --- a/components/ChauffeursTable.tsx +++ b/components/ChauffeursTable.tsx @@ -617,104 +617,217 @@ export default function ChauffeursTable() {
{/* Boutons d'action */} -
+
- {/* Tableau */} + {/* Tableau - Desktop */}
{loading ? (
Chargement...
) : chauffeurs.length === 0 ? (
Aucun chauffeur trouvé
) : ( -
- - - - - - - - - - - - - - {chauffeurs.map((chauffeur) => ( - - - - - - - - - ))} - -
- 0 && selectedIds.size === chauffeurs.length} - onChange={(e) => handleSelectAll(e.target.checked)} - className="w-4 h-4 text-lblue border-gray-300 rounded focus:ring-lblue" - /> - NOMCONTACTADRESSENOMBRES D'HEURESSTATUSACTIONS
+ <> + {/* Vue desktop - Tableau */} +
+ + + + + + + + + + + + + {chauffeurs.map((chauffeur) => ( + + + + + + + + + + ))} + +
handleSelectOne(chauffeur.id, e.target.checked)} + checked={chauffeurs.length > 0 && selectedIds.size === chauffeurs.length} + onChange={(e) => handleSelectAll(e.target.checked)} className="w-4 h-4 text-lblue border-gray-300 rounded focus:ring-lblue" /> - - -
-
- {getInitials(chauffeur.nom, chauffeur.prenom)} + +
NOMCONTACTADRESSENOMBRES D'HEURESSTATUSACTIONS
+ handleSelectOne(chauffeur.id, e.target.checked)} + className="w-4 h-4 text-lblue border-gray-300 rounded focus:ring-lblue" + /> + +
+
+ {getInitials(chauffeur.nom, chauffeur.prenom)} +
+
+
+ {chauffeur.prenom} {chauffeur.nom} +
+
+ Né le {formatDate(chauffeur.dateNaissance)} +
+
-
-
- {chauffeur.prenom} {chauffeur.nom} +
+
{chauffeur.telephone}
+
{chauffeur.email}
+
+
{chauffeur.adresse}
+
+
+
+ + {chauffeur.heuresRestantes || chauffeur.heuresContrat}h restantes sur {chauffeur.heuresContrat}h +
-
- Né le {formatDate(chauffeur.dateNaissance)} +
+
+
+ {chauffeur.status && ( + + {chauffeur.status} + + )} + +
+ + + +
+
+
+ + {/* Vue mobile - Cartes */} +
+ {chauffeurs.map((chauffeur) => ( +
+
+ {/* Checkbox */} + handleSelectOne(chauffeur.id, e.target.checked)} + className="w-4 h-4 text-lblue border-gray-300 rounded focus:ring-lblue mt-1" + /> + + {/* Avatar */} +
+ {getInitials(chauffeur.nom, chauffeur.prenom)} +
+ + {/* Contenu principal */} +
+ {/* Nom et date de naissance */} +
+
+ {chauffeur.prenom} {chauffeur.nom} +
+
+ Né le {formatDate(chauffeur.dateNaissance)} +
-
-
{chauffeur.telephone}
-
{chauffeur.email}
-
-
{chauffeur.adresse}
-
-
+ + {/* Contact */} + + + {/* Adresse */} +
+
Adresse
+
+ {chauffeur.adresse} +
+
+ + {/* Heures */} +
{chauffeur.heuresRestantes || chauffeur.heuresContrat}h restantes sur {chauffeur.heuresContrat}h @@ -727,51 +840,53 @@ export default function ChauffeursTable() { >
-
+ + {/* Status */} {chauffeur.status && ( - - {chauffeur.status} - +
+ + {chauffeur.status} + +
)} -
-
+ + {/* Actions */} +
-
-
+
+
+
+ ))} +
+ )}
@@ -1020,25 +1135,25 @@ export default function ChauffeursTable() { {/* Modal vue détaillée - Design épuré */} {viewingChauffeur && ( -
-
+
+
{/* Header épuré */} -
+
-
-
+
+
{getInitials(viewingChauffeur.nom, viewingChauffeur.prenom)}
-
-

+
+

{viewingChauffeur.prenom} {viewingChauffeur.nom}

-

+

Informations détaillées du chauffeur

{viewingChauffeur.status && (
- + {viewingChauffeur.status}
@@ -1047,9 +1162,9 @@ export default function ChauffeursTable() {
@@ -1058,46 +1173,46 @@ export default function ChauffeursTable() { {/* Contenu scrollable */}
-
+
{/* Actions rapides */} -
+ -
+
{/* Carte Informations personnelles */} -
-
-
- +
+
+
+
-

+

Informations personnelles

-
-
-
- +
+
+
+
@@ -1107,23 +1222,23 @@ export default function ChauffeursTable() {
-
-
- + -
-
- +
+
+
@@ -1135,49 +1250,49 @@ export default function ChauffeursTable() {
-
-
- +
+
+

Adresse

-

{viewingChauffeur.adresse}

+

{viewingChauffeur.adresse}

{/* Carte Informations contractuelles */} -
-
-
- +
+
+
+
-

+

Informations contractuelles

-
-
-
- +
+
+
+

Contrat d'heure

-

{viewingChauffeur.heuresContrat}h

+

{viewingChauffeur.heuresContrat}h

-
-
- +
+
+
@@ -1188,9 +1303,9 @@ export default function ChauffeursTable() {
{viewingChauffeur.dateFinContrat && ( -
-
- +
+
+
@@ -1203,15 +1318,15 @@ export default function ChauffeursTable() { {viewingChauffeur.heuresRestantes !== undefined && (
-
+

Heures restantes

- - {viewingChauffeur.heuresRestantes}h / {viewingChauffeur.heuresContrat}h + + {viewingChauffeur.heuresRestantes}h / {viewingChauffeur.heuresContrat}h
-
+
{/* Footer avec actions */} -
-
+
+
@@ -1246,9 +1361,9 @@ export default function ChauffeursTable() { setViewingChauffeur(null); handleEdit(viewingChauffeur); }} - className="px-6 py-2.5 bg-lblue text-white text-sm font-semibold rounded-lg hover:bg-dblue transition-colors flex items-center gap-2" + className="px-4 md:px-6 py-2.5 bg-lblue text-white text-sm font-semibold rounded-lg hover:bg-dblue transition-colors flex items-center justify-center gap-2 w-full md:w-auto" > - + Modifier le chauffeur diff --git a/components/ConfigurationContent.tsx b/components/ConfigurationContent.tsx index a8eac70..1321f39 100644 --- a/components/ConfigurationContent.tsx +++ b/components/ConfigurationContent.tsx @@ -170,6 +170,7 @@ OptionCard.displayName = 'OptionCard'; export default function ConfigurationContent() { const router = useRouter(); const { showNotification } = useNotification(); + const [isMobile, setIsMobile] = useState(false); const [activeConfigSection, setActiveConfigSection] = useState<'adherents' | 'comptes' | 'roles' | null>('adherents'); const [options, setOptions] = useState({ situation: [], @@ -225,6 +226,15 @@ export default function ConfigurationContent() { // eslint-disable-next-line react-hooks/exhaustive-deps }, []); + useEffect(() => { + const checkMobile = () => { + setIsMobile(window.innerWidth < 768); + }; + checkMobile(); + window.addEventListener('resize', checkMobile); + return () => window.removeEventListener('resize', checkMobile); + }, []); + const handleAdd = useCallback(async (type: 'situation' | 'prescripteur' | 'facturation' | 'forfait') => { const currentValue = newValue[type]?.trim() || ''; if (!currentValue) { @@ -1097,6 +1107,35 @@ export default function ConfigurationContent() { ); }; + // Afficher une modale sur mobile + if (isMobile) { + return ( +
+
+
+
+ + + +
+

+ Configuration sur ordinateur recommandée +

+

+ Pour une meilleure expérience, veuillez utiliser un ordinateur pour accéder à la configuration de la plateforme. +

+
+ +
+
+ ); + } + return (
diff --git a/components/DashboardContent.tsx b/components/DashboardContent.tsx index daacf31..7ac8a60 100644 --- a/components/DashboardContent.tsx +++ b/components/DashboardContent.tsx @@ -156,54 +156,54 @@ export default function DashboardContent({ userName }: DashboardContentProps) { }; return ( -
+
{/* En-tête */} -
-

+
+

Content de vous revoir {userName || 'Utilisateur'}

-

+

Bienvenue sur votre tableau de bord.

{/* Statistiques */} -
+
{/* Participations du mois */} -
-
-
- +
+
+
+
-

Participations du mois

-

+

Participations du mois

+

{stats ? `${stats.participationsMois.montant.toFixed(2).replace('.', ',')}€` : '0,00€'}

-

+

{stats ? `${stats.participationsMois.nombreFactures} ${stats.participationsMois.nombreFactures > 1 ? 'Factures' : 'Facture'}` : '0 Facture'}

{/* Trajets Aujourd'hui */} -
-
-
- +
+
+
+
-

Trajets Aujourd'hui

-

+

Trajets Aujourd'hui

+

{stats ? stats.trajetsAujourdhui.nombre : 0}

-

+

{stats && stats.trajetsAujourdhui.difference !== 0 ? `${stats.trajetsAujourdhui.difference > 0 ? '+' : ''}${stats.trajetsAujourdhui.difference} vs hier` : 'Aucun changement'} @@ -212,20 +212,20 @@ export default function DashboardContent({ userName }: DashboardContentProps) {

{/* Trajets réalisés ce mois */} -
-
-
- +
+
+
+
-

Trajets réalisés ce mois

-

+

Trajets réalisés ce mois

+

{stats ? stats.trajetsRealisesMois.nombre : 0}

-

+

{stats && stats.trajetsRealisesMois.pourcentageEvolution !== 0 ? `${stats.trajetsRealisesMois.pourcentageEvolution > 0 ? '+' : ''}${stats.trajetsRealisesMois.pourcentageEvolution}% vs mois dernier` : 'Aucun changement'} @@ -234,20 +234,20 @@ export default function DashboardContent({ userName }: DashboardContentProps) {

{/* Chauffeurs actifs */} -
-
-
- +
+
+
+
-

Chauffeurs actifs

-

+

Chauffeurs actifs

+

{stats ? stats.chauffeursActifs.nombre : 0}

-

+

{stats ? `Sur ${stats.chauffeursActifs.total} total` : 'Sur 0 total'}

@@ -255,126 +255,126 @@ export default function DashboardContent({ userName }: DashboardContentProps) {
{/* Actions Rapides et Trajets Récents côte à côte */} -
+
{/* Actions Rapides */}
-
-

Actions Rapides

+
+

Actions Rapides

-
+
-
-
- +
+
+
-

Bientôt ?

+

Bientôt ?

{/* Trajets Récents */}
-
-

Trajets Récents

+
+

Trajets Récents

{loading ? ( -
Chargement...
+
Chargement...
) : trajetsRecents.length === 0 ? ( -
+
Aucun trajet créé récemment
) : ( -
+
{trajetsRecents.map((trajet) => (
setSelectedTrajet(trajet)} - className="p-4 bg-gray-50 rounded-lg border border-gray-200 hover:border-gray-300 hover:shadow-sm transition-all cursor-pointer" + className="p-3 sm:p-4 bg-gray-50 rounded-lg border border-gray-200 hover:border-gray-300 hover:shadow-sm transition-all cursor-pointer" > -
+
{/* Avatar adhérent */} -
+
{getInitials(trajet.adherent.nom, trajet.adherent.prenom)}
{/* Informations principales */}
-
-
-

+
+
+

{trajet.adherent.prenom} {trajet.adherent.nom}

-
- - +
+ + {formatDate(trajet.date)} - - + + {formatTime(trajet.date)} -
+
Départ:{' '} - {trajet.adresseDepart} + {trajet.adresseDepart}
-
+
Arrivée:{' '} - {trajet.adresseArrivee} + {trajet.adresseArrivee}
{/* Chauffeur */} -
+
{trajet.chauffeur ? (
-
+
{getInitials(trajet.chauffeur.nom, trajet.chauffeur.prenom)}
-
Chauffeur
-
+
Chauffeur
+
{trajet.chauffeur.prenom} {trajet.chauffeur.nom}
) : ( -
- +
+ - + Aucun chauffeur assigné
@@ -433,7 +433,7 @@ export default function DashboardContent({ userName }: DashboardContentProps) { {/* Commentaire */} {trajet.commentaire && (
-

{trajet.commentaire}

+

{trajet.commentaire}

)}
diff --git a/components/DashboardLayout.tsx b/components/DashboardLayout.tsx index 6a8e8e2..f64d836 100644 --- a/components/DashboardLayout.tsx +++ b/components/DashboardLayout.tsx @@ -33,6 +33,7 @@ export default function DashboardLayout({ user, children }: DashboardLayoutProps const [loading, setLoading] = useState(false); const [showNotifications, setShowNotifications] = useState(false); const [showProfileMenu, setShowProfileMenu] = useState(false); + const [sidebarOpen, setSidebarOpen] = useState(false); // Récupérer les conversations pour compter les messages non lus const { data: conversations } = useSWR>( @@ -190,10 +191,20 @@ export default function DashboardLayout({ user, children }: DashboardLayoutProps return (
+ {/* Mobile Sidebar Overlay */} + {sidebarOpen && ( +
setSidebarOpen(false)} + /> + )} + {/* Sidebar */} -