refactor: revew all design of services, clients, deadcode, ...
This commit is contained in:
@@ -6,8 +6,8 @@ import { Button } from "@/components/ui/button";
|
||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Skeleton } from "@/components/ui/skeleton";
|
||||
import { TeamMember } from "@/services/admin-management-service";
|
||||
import { AdminManagementService } from "@/services/admin-management-service";
|
||||
import { TeamMember } from "@/clients/domains/admin-client";
|
||||
import { adminClient } from "@/clients";
|
||||
import { useToast } from "@/hooks/use-toast";
|
||||
|
||||
interface TeamMembersModalProps {
|
||||
@@ -41,7 +41,7 @@ export function TeamMembersModal({
|
||||
setIsLoading(true);
|
||||
setError(null);
|
||||
try {
|
||||
const membersData = await AdminManagementService.getTeamMembers(teamId);
|
||||
const membersData = await adminClient.getTeamMembers(teamId);
|
||||
setMembers(membersData);
|
||||
} catch (err: any) {
|
||||
setError(err.message || "Erreur lors du chargement des membres");
|
||||
@@ -59,7 +59,7 @@ export function TeamMembersModal({
|
||||
|
||||
setDeletingMemberId(memberId);
|
||||
try {
|
||||
await AdminManagementService.removeTeamMember(teamId, memberId);
|
||||
await adminClient.removeTeamMember(teamId, memberId);
|
||||
|
||||
// Mettre à jour la liste locale
|
||||
setMembers((prev) => prev.filter((member) => member.id !== memberId));
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { useState } from "react";
|
||||
import { Team, SkillCategory } from "@/lib/types";
|
||||
import { TeamStats, DirectionStats } from "@/services/admin-service";
|
||||
import { TeamStats, DirectionStats } from "@/lib/admin-types";
|
||||
import { TeamDetailModal } from "../team-detail/team-detail-modal";
|
||||
import { AdminHeader } from "../utils/admin-header";
|
||||
import { AdminOverviewCards } from "./admin-overview-cards";
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
||||
import { Users, Building2 } from "lucide-react";
|
||||
import { TeamStats, DirectionStats } from "@/services/admin-service";
|
||||
import { TeamStats, DirectionStats } from "@/lib/admin-types";
|
||||
import { DirectionOverview, TeamStatsCard } from "@/components/admin";
|
||||
|
||||
interface AdminContentTabsProps {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { Users, Target, Building2, UserCheck } from "lucide-react";
|
||||
import { Team, SkillCategory } from "@/lib/types";
|
||||
import { TeamStats, DirectionStats } from "@/services/admin-service";
|
||||
import { TeamStats, DirectionStats } from "@/lib/admin-types";
|
||||
|
||||
interface AdminOverviewCardsProps {
|
||||
teams: Team[];
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
} from "lucide-react";
|
||||
import { TreeCategoryHeader, TreeItemRow } from "@/components/admin";
|
||||
import { TechIcon } from "@/components/icons/tech-icon";
|
||||
import { Skill } from "@/services/admin-management-service";
|
||||
import { Skill } from "@/clients/domains/admin-client";
|
||||
|
||||
interface SkillsListProps {
|
||||
filteredSkillsByCategory: Record<string, Skill[]>;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import React, { useState, useEffect } from "react";
|
||||
import { TeamStats, TeamMember } from "@/services/admin-service";
|
||||
import { TeamStats, TeamMember } from "@/lib/admin-types";
|
||||
import { TeamDetailHeader } from "./team-detail-header";
|
||||
import { TeamMetricsCards } from "./team-metrics-cards";
|
||||
import { TeamDetailTabs } from "./team-detail-tabs";
|
||||
|
||||
@@ -13,7 +13,7 @@ import { Button } from "@/components/ui/button";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Users, ExternalLink, Download, Eye } from "lucide-react";
|
||||
|
||||
import { TeamMember } from "@/services/admin-service";
|
||||
import { TeamMember } from "@/lib/admin-types";
|
||||
|
||||
interface TeamDetailModalProps {
|
||||
isOpen: boolean;
|
||||
|
||||
@@ -5,7 +5,7 @@ import { TeamOverviewTab } from "./team-overview-tab";
|
||||
import { TeamSkillsTab } from "./team-skills-tab";
|
||||
import { TeamMembersTab } from "./team-members-tab";
|
||||
import { TeamInsightsTab } from "./team-insights-tab";
|
||||
import { TeamStats, TeamMember } from "@/services/admin-service";
|
||||
import { TeamStats, TeamMember } from "@/lib/admin-types";
|
||||
|
||||
interface SkillAnalysis {
|
||||
skillName: string;
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { User, Award, BookOpen, X } from "lucide-react";
|
||||
import { TeamMember } from "@/services/admin-service";
|
||||
import { TeamMember } from "@/lib/admin-types";
|
||||
|
||||
interface TeamMemberModalProps {
|
||||
isOpen: boolean;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import { User, Award, BookOpen } from "lucide-react";
|
||||
import { TeamMember } from "@/services/admin-service";
|
||||
import { TeamMember } from "@/lib/admin-types";
|
||||
|
||||
interface TeamMembersTabProps {
|
||||
members: TeamMember[];
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import { BarChart3, Target, Star } from "lucide-react";
|
||||
import { TeamStats } from "@/services/admin-service";
|
||||
import { TeamStats } from "@/lib/admin-types";
|
||||
import { TechIcon } from "@/components/icons/tech-icon";
|
||||
|
||||
interface SkillAnalysis {
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
"use client";
|
||||
|
||||
import { Users, Building2 } from "lucide-react";
|
||||
import { TreeCategoryHeader, TreeItemRow, TeamMetrics } from "@/components/admin";
|
||||
import {
|
||||
TreeCategoryHeader,
|
||||
TreeItemRow,
|
||||
TeamMetrics,
|
||||
} from "@/components/admin";
|
||||
import { Team as TeamType } from "@/lib/types";
|
||||
import { TeamStats } from "@/services/admin-service";
|
||||
import { TeamStats } from "@/lib/admin-types";
|
||||
|
||||
interface TeamsListProps {
|
||||
filteredTeamsByDirection: Record<string, TeamType[]>;
|
||||
|
||||
@@ -4,7 +4,7 @@ import { useState } from "react";
|
||||
import { Plus, Building2 } from "lucide-react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { SkillCategory, Team as TeamType } from "@/lib/types";
|
||||
import { TeamStats } from "@/services/admin-service";
|
||||
import { TeamStats } from "@/lib/admin-types";
|
||||
import { TreeViewPage } from "../management/tree-view-page";
|
||||
import { useTreeView } from "@/hooks/use-tree-view";
|
||||
import { useFormDialog } from "@/hooks/use-form-dialog";
|
||||
@@ -27,9 +27,16 @@ export function TeamsManagementPage({
|
||||
const [searchTerm, setSearchTerm] = useState("");
|
||||
const [isMembersModalOpen, setIsMembersModalOpen] = useState(false);
|
||||
const [selectedTeam, setSelectedTeam] = useState<TeamType | null>(null);
|
||||
|
||||
const { isCreateDialogOpen, isEditDialogOpen, openCreateDialog, closeCreateDialog, openEditDialog, closeEditDialog } = useFormDialog();
|
||||
|
||||
|
||||
const {
|
||||
isCreateDialogOpen,
|
||||
isEditDialogOpen,
|
||||
openCreateDialog,
|
||||
closeCreateDialog,
|
||||
openEditDialog,
|
||||
closeEditDialog,
|
||||
} = useFormDialog();
|
||||
|
||||
const {
|
||||
teams: localTeams,
|
||||
teamStats: localTeamStats,
|
||||
|
||||
@@ -16,7 +16,7 @@ import {
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
} from "@/components/ui/dialog";
|
||||
import { Team } from "@/services/admin-management-service";
|
||||
import { Team } from "@/clients/domains/admin-client";
|
||||
|
||||
interface UserFormData {
|
||||
firstName: string;
|
||||
@@ -98,7 +98,11 @@ export function UserFormDialog({
|
||||
Annuler
|
||||
</Button>
|
||||
<Button onClick={onSubmit} disabled={isSubmitting}>
|
||||
{isSubmitting ? "En cours..." : title.includes("Créer") ? "Créer" : "Mettre à jour"}
|
||||
{isSubmitting
|
||||
? "En cours..."
|
||||
: title.includes("Créer")
|
||||
? "Créer"
|
||||
: "Mettre à jour"}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import { useState } from "react";
|
||||
import { Users, Building2 } from "lucide-react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Team } from "@/services/admin-management-service";
|
||||
import { Team } from "@/clients/domains/admin-client";
|
||||
import { TreeViewPage } from "../management/tree-view-page";
|
||||
import { useTreeView } from "@/hooks/use-tree-view";
|
||||
import { useFormDialog } from "@/hooks/use-form-dialog";
|
||||
@@ -17,9 +17,10 @@ interface UsersManagementPageProps {
|
||||
|
||||
export function UsersManagementPage({ teams }: UsersManagementPageProps) {
|
||||
const [searchTerm, setSearchTerm] = useState("");
|
||||
|
||||
const { isCreateDialogOpen, openCreateDialog, closeCreateDialog } = useFormDialog();
|
||||
|
||||
|
||||
const { isCreateDialogOpen, openCreateDialog, closeCreateDialog } =
|
||||
useFormDialog();
|
||||
|
||||
const {
|
||||
users,
|
||||
isLoading,
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Users, Target, Building2, Filter } from "lucide-react";
|
||||
import { Team } from "@/lib/types";
|
||||
import { TeamStats } from "@/services/admin-service";
|
||||
import { TeamStats } from "@/lib/admin-types";
|
||||
import { MultiSelectFilter } from "./multi-select-filter";
|
||||
|
||||
interface AdminFiltersProps {
|
||||
|
||||
@@ -6,7 +6,7 @@ import { Input } from "@/components/ui/input";
|
||||
import { Textarea } from "@/components/ui/textarea";
|
||||
import { Label } from "@/components/ui/label";
|
||||
import { Plus, X, Link as LinkIcon, Loader2 } from "lucide-react";
|
||||
import { apiClient } from "@/services/client";
|
||||
import { skillsClient } from "@/clients";
|
||||
|
||||
interface CreateSkillFormProps {
|
||||
categoryName: string;
|
||||
@@ -29,31 +29,31 @@ export function CreateSkillForm({
|
||||
const [error, setError] = useState("");
|
||||
|
||||
const addLink = () => {
|
||||
setFormData(prev => ({
|
||||
setFormData((prev) => ({
|
||||
...prev,
|
||||
links: [...prev.links, ""]
|
||||
links: [...prev.links, ""],
|
||||
}));
|
||||
};
|
||||
|
||||
const removeLink = (index: number) => {
|
||||
setFormData(prev => ({
|
||||
setFormData((prev) => ({
|
||||
...prev,
|
||||
links: prev.links.filter((_, i) => i !== index)
|
||||
links: prev.links.filter((_, i) => i !== index),
|
||||
}));
|
||||
};
|
||||
|
||||
const updateLink = (index: number, value: string) => {
|
||||
setFormData(prev => ({
|
||||
setFormData((prev) => ({
|
||||
...prev,
|
||||
links: prev.links.map((link, i) => i === index ? value : link)
|
||||
links: prev.links.map((link, i) => (i === index ? value : link)),
|
||||
}));
|
||||
};
|
||||
|
||||
const generateSkillId = (name: string) => {
|
||||
return name
|
||||
.toLowerCase()
|
||||
.replace(/[^a-z0-9\s]/g, '')
|
||||
.replace(/\s+/g, '-')
|
||||
.replace(/[^a-z0-9\s]/g, "")
|
||||
.replace(/\s+/g, "-")
|
||||
.trim();
|
||||
};
|
||||
|
||||
@@ -80,7 +80,7 @@ export function CreateSkillForm({
|
||||
const categoryId = getCategoryId(categoryName);
|
||||
|
||||
// Filtrer les liens vides
|
||||
const validLinks = formData.links.filter(link => link.trim());
|
||||
const validLinks = formData.links.filter((link) => link.trim());
|
||||
|
||||
const skillData = {
|
||||
id: skillId,
|
||||
@@ -90,7 +90,7 @@ export function CreateSkillForm({
|
||||
links: validLinks,
|
||||
};
|
||||
|
||||
const success = await apiClient.createSkill(categoryId, skillData);
|
||||
const success = await skillsClient.createSkill(categoryId, skillData);
|
||||
|
||||
if (success) {
|
||||
onSuccess(skillId);
|
||||
@@ -118,7 +118,9 @@ export function CreateSkillForm({
|
||||
id="skill-name"
|
||||
placeholder="ex: Next.js, Docker, Figma..."
|
||||
value={formData.name}
|
||||
onChange={(e) => setFormData(prev => ({ ...prev, name: e.target.value }))}
|
||||
onChange={(e) =>
|
||||
setFormData((prev) => ({ ...prev, name: e.target.value }))
|
||||
}
|
||||
disabled={isLoading}
|
||||
/>
|
||||
</div>
|
||||
@@ -129,7 +131,9 @@ export function CreateSkillForm({
|
||||
id="skill-description"
|
||||
placeholder="Décrivez brièvement cette compétence..."
|
||||
value={formData.description}
|
||||
onChange={(e) => setFormData(prev => ({ ...prev, description: e.target.value }))}
|
||||
onChange={(e) =>
|
||||
setFormData((prev) => ({ ...prev, description: e.target.value }))
|
||||
}
|
||||
disabled={isLoading}
|
||||
rows={3}
|
||||
/>
|
||||
@@ -141,11 +145,14 @@ export function CreateSkillForm({
|
||||
id="skill-icon"
|
||||
placeholder="ex: fab-react, fas-database..."
|
||||
value={formData.icon}
|
||||
onChange={(e) => setFormData(prev => ({ ...prev, icon: e.target.value }))}
|
||||
onChange={(e) =>
|
||||
setFormData((prev) => ({ ...prev, icon: e.target.value }))
|
||||
}
|
||||
disabled={isLoading}
|
||||
/>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
Utilisez les classes FontAwesome (fab-, fas-, far-) ou laissez vide pour l'icône par défaut
|
||||
Utilisez les classes FontAwesome (fab-, fas-, far-) ou laissez vide
|
||||
pour l'icône par défaut
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -205,7 +212,12 @@ export function CreateSkillForm({
|
||||
</>
|
||||
)}
|
||||
</Button>
|
||||
<Button type="button" variant="outline" onClick={onCancel} disabled={isLoading}>
|
||||
<Button
|
||||
type="button"
|
||||
variant="outline"
|
||||
onClick={onCancel}
|
||||
disabled={isLoading}
|
||||
>
|
||||
Annuler
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
3
components/login/index.ts
Normal file
3
components/login/index.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export { LoginFormWrapper } from "./login-form-wrapper";
|
||||
export { LoginLoading } from "./login-loading";
|
||||
export { LoginLayout } from "./login-layout";
|
||||
213
components/login/login-form-wrapper.tsx
Normal file
213
components/login/login-form-wrapper.tsx
Normal file
@@ -0,0 +1,213 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect, useState } from "react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { ProfileForm } from "@/components/profile-form";
|
||||
import { authClient } from "@/clients";
|
||||
import { UserProfile, Team } from "@/lib/types";
|
||||
import { Code2, LogOut, Edit, X, Home } from "lucide-react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
Card,
|
||||
CardContent,
|
||||
CardDescription,
|
||||
CardHeader,
|
||||
CardTitle,
|
||||
} from "@/components/ui/card";
|
||||
|
||||
interface LoginFormWrapperProps {
|
||||
teams: Team[];
|
||||
initialUser?: UserProfile | null;
|
||||
}
|
||||
|
||||
export function LoginFormWrapper({
|
||||
teams,
|
||||
initialUser,
|
||||
}: LoginFormWrapperProps) {
|
||||
const [authenticating, setAuthenticating] = useState(false);
|
||||
const [currentUser, setCurrentUser] = useState<UserProfile | null>(
|
||||
initialUser || null
|
||||
);
|
||||
const [isEditing, setIsEditing] = useState(false);
|
||||
const router = useRouter();
|
||||
|
||||
useEffect(() => {
|
||||
if (initialUser) {
|
||||
setCurrentUser(initialUser);
|
||||
}
|
||||
}, [initialUser]);
|
||||
|
||||
const handleSubmit = async (profile: UserProfile) => {
|
||||
setAuthenticating(true);
|
||||
try {
|
||||
await authClient.login(profile);
|
||||
if (isEditing) {
|
||||
// Si on modifie le profil existant, mettre à jour l'état
|
||||
setCurrentUser(profile);
|
||||
setIsEditing(false);
|
||||
} else {
|
||||
// Si c'est un nouveau login, rediriger
|
||||
router.push("/");
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Login failed:", error);
|
||||
// Vous pouvez ajouter une notification d'erreur ici
|
||||
} finally {
|
||||
setAuthenticating(false);
|
||||
}
|
||||
};
|
||||
|
||||
const handleLogout = async () => {
|
||||
try {
|
||||
await authClient.logout();
|
||||
setCurrentUser(null);
|
||||
setIsEditing(false);
|
||||
} catch (error) {
|
||||
console.error("Logout failed:", error);
|
||||
}
|
||||
};
|
||||
|
||||
const handleEdit = () => {
|
||||
setIsEditing(true);
|
||||
};
|
||||
|
||||
const handleCancelEdit = () => {
|
||||
setIsEditing(false);
|
||||
};
|
||||
|
||||
// Si l'utilisateur est connecté et qu'on ne modifie pas
|
||||
if (currentUser && !isEditing) {
|
||||
const currentTeam = teams.find((t) => t.id === currentUser.teamId);
|
||||
|
||||
return (
|
||||
<div className="text-center mb-12">
|
||||
<div className="inline-flex items-center gap-2 px-4 py-2 rounded-full bg-white/5 border border-white/10 backdrop-blur-sm mb-6">
|
||||
<Code2 className="h-4 w-4 text-blue-400" />
|
||||
<span className="text-sm font-medium text-slate-200">PeakSkills</span>
|
||||
</div>
|
||||
|
||||
<h1 className="text-4xl font-bold mb-4 text-white">
|
||||
Vous êtes connecté
|
||||
</h1>
|
||||
<p className="text-lg text-slate-400 mb-8">
|
||||
Gérez votre profil ou retournez à l'application
|
||||
</p>
|
||||
|
||||
<div className="max-w-2xl mx-auto space-y-6">
|
||||
{/* Informations utilisateur */}
|
||||
<Card className="bg-white/5 border-white/10 backdrop-blur-sm">
|
||||
<CardHeader>
|
||||
<CardTitle className="text-white">Vos informations</CardTitle>
|
||||
<CardDescription className="text-slate-400">
|
||||
Profil actuellement connecté
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-4">
|
||||
<div className="grid grid-cols-2 gap-4">
|
||||
<div>
|
||||
<label className="text-sm font-medium text-slate-300">
|
||||
Prénom
|
||||
</label>
|
||||
<p className="text-white">{currentUser.firstName}</p>
|
||||
</div>
|
||||
<div>
|
||||
<label className="text-sm font-medium text-slate-300">
|
||||
Nom
|
||||
</label>
|
||||
<p className="text-white">{currentUser.lastName}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<label className="text-sm font-medium text-slate-300">
|
||||
Équipe
|
||||
</label>
|
||||
<p className="text-white">
|
||||
{currentTeam?.name || "Équipe non trouvée"}
|
||||
</p>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
{/* Actions */}
|
||||
<div className="flex gap-4 justify-center">
|
||||
<Button
|
||||
onClick={() => router.push("/")}
|
||||
className="bg-blue-500 hover:bg-blue-600 text-white"
|
||||
>
|
||||
<Home className="w-4 h-4 mr-2" />
|
||||
Retour à l'accueil
|
||||
</Button>
|
||||
<Button
|
||||
onClick={handleEdit}
|
||||
variant="outline"
|
||||
className="border-white/20 text-white hover:bg-white/10"
|
||||
>
|
||||
<Edit className="w-4 h-4 mr-2" />
|
||||
Modifier le profil
|
||||
</Button>
|
||||
<Button
|
||||
onClick={handleLogout}
|
||||
variant="outline"
|
||||
className="border-red-500/50 text-red-400 hover:bg-red-500/10"
|
||||
>
|
||||
<LogOut className="w-4 h-4 mr-2" />
|
||||
Se déconnecter
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
// Sinon, afficher le formulaire (nouvel utilisateur ou modification)
|
||||
return (
|
||||
<div className="text-center mb-12">
|
||||
<div className="inline-flex items-center gap-2 px-4 py-2 rounded-full bg-white/5 border border-white/10 backdrop-blur-sm mb-6">
|
||||
<Code2 className="h-4 w-4 text-blue-400" />
|
||||
<span className="text-sm font-medium text-slate-200">PeakSkills</span>
|
||||
</div>
|
||||
|
||||
<h1 className="text-4xl font-bold mb-4 text-white">
|
||||
{isEditing ? "Modifier vos informations" : "Bienvenue sur PeakSkills"}
|
||||
</h1>
|
||||
<p className="text-lg text-slate-400 mb-8">
|
||||
{isEditing
|
||||
? "Mettez à jour vos informations personnelles"
|
||||
: "Évaluez vos compétences techniques et suivez votre progression"}
|
||||
</p>
|
||||
|
||||
{isEditing && (
|
||||
<Button
|
||||
onClick={handleCancelEdit}
|
||||
variant="outline"
|
||||
className="mb-8 border-white/20 text-white hover:bg-white/10"
|
||||
>
|
||||
<X className="w-4 h-4 mr-2" />
|
||||
Annuler
|
||||
</Button>
|
||||
)}
|
||||
|
||||
<div className="max-w-2xl mx-auto">
|
||||
<div className="relative">
|
||||
{authenticating && (
|
||||
<div className="absolute inset-0 bg-black/20 backdrop-blur-sm z-10 flex items-center justify-center rounded-lg">
|
||||
<div className="text-center">
|
||||
<div className="animate-spin rounded-full h-6 w-6 border-b-2 border-blue-400 mx-auto mb-2"></div>
|
||||
<p className="text-white text-sm">
|
||||
{isEditing
|
||||
? "Mise à jour en cours..."
|
||||
: "Connexion en cours..."}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
<ProfileForm
|
||||
teams={teams}
|
||||
onSubmit={handleSubmit}
|
||||
initialProfile={isEditing && currentUser ? currentUser : undefined}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
18
components/login/login-layout.tsx
Normal file
18
components/login/login-layout.tsx
Normal file
@@ -0,0 +1,18 @@
|
||||
import { Code2 } from "lucide-react";
|
||||
|
||||
interface LoginLayoutProps {
|
||||
children: React.ReactNode;
|
||||
}
|
||||
|
||||
export function LoginLayout({ children }: LoginLayoutProps) {
|
||||
return (
|
||||
<div className="min-h-screen bg-gradient-to-br from-slate-950 via-slate-900 to-slate-950 relative overflow-hidden">
|
||||
<div className="absolute inset-0 bg-[radial-gradient(ellipse_at_top,_var(--tw-gradient-stops))] from-blue-900/20 via-slate-900 to-slate-950" />
|
||||
<div className="absolute inset-0 bg-grid-white/5 bg-[size:50px_50px]" />
|
||||
|
||||
<div className="relative z-10 container mx-auto py-16 px-6">
|
||||
{children}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
17
components/login/login-loading.tsx
Normal file
17
components/login/login-loading.tsx
Normal file
@@ -0,0 +1,17 @@
|
||||
export function LoginLoading() {
|
||||
return (
|
||||
<div className="min-h-screen bg-gradient-to-br from-slate-950 via-slate-900 to-slate-950 relative overflow-hidden">
|
||||
<div className="absolute inset-0 bg-[radial-gradient(ellipse_at_top,_var(--tw-gradient-stops))] from-blue-900/20 via-slate-900 to-slate-950" />
|
||||
<div className="absolute inset-0 bg-grid-white/5 bg-[size:50px_50px]" />
|
||||
|
||||
<div className="relative z-10 container mx-auto py-16 px-6">
|
||||
<div className="flex items-center justify-center min-h-[400px]">
|
||||
<div className="text-center">
|
||||
<div className="animate-spin rounded-full h-8 w-8 border-b-2 border-blue-400 mx-auto mb-4"></div>
|
||||
<p className="text-white">Chargement...</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user