diff --git a/src/app/page.tsx b/src/app/page.tsx index 32553cf..8cd8ee6 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -27,7 +27,7 @@ export default function HomePage() { locations: content.schedule.locations.length, }} /> - + diff --git a/src/components/sections/Team.tsx b/src/components/sections/Team.tsx index ba8cafd..3f1319c 100644 --- a/src/components/sections/Team.tsx +++ b/src/components/sections/Team.tsx @@ -6,13 +6,14 @@ import { Reveal } from "@/components/ui/Reveal"; import { TeamCarousel } from "@/components/sections/team/TeamCarousel"; import { TeamMemberInfo } from "@/components/sections/team/TeamMemberInfo"; import { TeamProfile } from "@/components/sections/team/TeamProfile"; -import type { SiteContent } from "@/types/content"; +import type { SiteContent, ScheduleLocation } from "@/types/content"; interface TeamProps { data: SiteContent["team"]; + schedule?: ScheduleLocation[]; } -export function Team({ data: team }: TeamProps) { +export function Team({ data: team, schedule }: TeamProps) { const [activeIndex, setActiveIndex] = useState(0); const [showProfile, setShowProfile] = useState(false); @@ -61,6 +62,7 @@ export function Team({ data: team }: TeamProps) { setShowProfile(false)} + schedule={schedule} /> )} diff --git a/src/components/sections/team/TeamProfile.tsx b/src/components/sections/team/TeamProfile.tsx index 9509ffc..188b88f 100644 --- a/src/components/sections/team/TeamProfile.tsx +++ b/src/components/sections/team/TeamProfile.tsx @@ -1,14 +1,15 @@ import { useState, useEffect, useRef, useCallback } from "react"; import Image from "next/image"; -import { ArrowLeft, Instagram, Trophy, GraduationCap, ExternalLink, X, Award, Scale } from "lucide-react"; -import type { TeamMember, RichListItem, VictoryItem } from "@/types/content"; +import { ArrowLeft, Instagram, Trophy, GraduationCap, ExternalLink, X, Award, Scale, Clock, MapPin } from "lucide-react"; +import type { TeamMember, RichListItem, VictoryItem, ScheduleLocation } from "@/types/content"; interface TeamProfileProps { member: TeamMember; onBack: () => void; + schedule?: ScheduleLocation[]; } -export function TeamProfile({ member, onBack }: TeamProfileProps) { +export function TeamProfile({ member, onBack, schedule }: TeamProfileProps) { const [lightbox, setLightbox] = useState(null); useEffect(() => { @@ -33,7 +34,28 @@ export function TeamProfile({ member, onBack }: TeamProfileProps) { const [activeTab, setActiveTab] = useState(victoryTabs[0]?.key ?? 'place'); const hasExperience = member.experience && member.experience.length > 0; const hasEducation = member.education && member.education.length > 0; - const hasBio = hasVictories || hasExperience || hasEducation; + + // Extract trainer's groups from schedule, grouped by type + time + location + const groupMap = new Map(); + schedule?.forEach(location => { + location.days.forEach(day => { + day.classes + .filter(c => c.trainer === member.name) + .forEach(c => { + const key = `${c.type}|${c.time}|${location.name}`; + const existing = groupMap.get(key); + if (existing) { + if (!existing.days.includes(day.dayShort)) existing.days.push(day.dayShort); + } else { + groupMap.set(key, { type: c.type, time: c.time, location: location.name, address: location.address, days: [day.dayShort], level: c.level, recruiting: c.recruiting }); + } + }); + }); + }); + const uniqueGroups = Array.from(groupMap.values()); + const hasGroups = uniqueGroups.length > 0; + + const hasBio = hasVictories || hasExperience || hasEducation || hasGroups; return ( )} + {/* Groups */} + {hasGroups && ( + + + + Группы + + + {uniqueGroups.map((g, i) => ( + + {g.type} + + + {g.days.join(", ")} · {g.time} + + + + {g.location} · {g.address.replace(/^г\.\s*\S+,\s*/, "")} + + {g.level && ( + {g.level} + )} + {g.recruiting && ( + + Набор открыт + + )} + + ))} + + + )} + {/* Education */} {hasEducation && ( - + Образование @@ -163,7 +218,7 @@ export function TeamProfile({ member, onBack }: TeamProfileProps) { {/* Experience */} {hasExperience && ( - + Опыт
{g.type}
{g.level}