diff --git a/src/components/sections/Classes.tsx b/src/components/sections/Classes.tsx index 5e4300d..856521a 100644 --- a/src/components/sections/Classes.tsx +++ b/src/components/sections/Classes.tsx @@ -1,5 +1,6 @@ "use client"; +import { useState } from "react"; import Image from "next/image"; import type { LucideIcon } from "lucide-react"; import { @@ -7,16 +8,13 @@ import { Dumbbell, Wind, Moon, Sun, Ribbon, Gem, Feather, CircleDot, Activity, Drama, PersonStanding, Footprints, PartyPopper, Flower2, Waves, Eye, Orbit, Brush, Palette, HandMetal, Theater, + ArrowUpRight, X, } from "lucide-react"; import { SectionHeading } from "@/components/ui/SectionHeading"; import { Reveal } from "@/components/ui/Reveal"; -import { ShowcaseLayout } from "@/components/ui/ShowcaseLayout"; -import { useShowcaseRotation } from "@/hooks/useShowcaseRotation"; import type { ClassItem, SiteContent } from "@/types"; -import { UI_CONFIG } from "@/lib/config"; import { formatMarkup } from "@/lib/markup"; -/** Map of kebab-case icon keys to their components (curated for dance school) */ const ICON_MAP: Record = { "flame": Flame, "heart": Heart, "heart-pulse": HeartPulse, "star": Star, "sparkles": Sparkles, "music": Music, "zap": Zap, "crown": Crown, @@ -30,7 +28,7 @@ const ICON_MAP: Record = { function getIcon(key: string) { const Icon = ICON_MAP[key]; - return Icon ? : null; + return Icon ? : null; } interface ClassesProps { @@ -38,100 +36,138 @@ interface ClassesProps { } export function Classes({ data: classes }: ClassesProps) { + const [selected, setSelected] = useState(null); + if (!classes?.items?.length) return null; - const { activeIndex, select, setHovering } = useShowcaseRotation({ - totalItems: classes.items.length, - autoPlayInterval: UI_CONFIG.showcase.autoPlayInterval, - }); return (
-
+
{classes.title} -
- - - items={classes.items} - activeIndex={activeIndex} - onSelect={select} - onHoverChange={setHovering} - getItemLabel={(item) => item.name} - renderDetail={(item) => ( -
- {/* Hero image */} - {item.images && item.images[0] && ( -
- {item.name} 1 ? `scale(${item.imageZoom})` : undefined, - }} - /> - {/* Gradient overlay */} -
- - {/* Icon + name overlay */} -
-
- {getIcon(item.icon)} -
-

- {item.name} -

-
-
- )} - - {/* Description */} - {item.detailedDescription && ( -
- {formatMarkup(item.detailedDescription)} -
- )} -
- )} - renderSelectorItem={(item, _i, isActive) => ( -
- {/* Icon */} -
- {getIcon(item.icon)} -
-
-

+

+ {classes.items.map((item, i) => ( + + + + ))}
+ + {/* Detail modal */} + {selected && ( + setSelected(null)} /> + )}
); } + +function ClassDetailModal({ item, onClose }: { item: ClassItem; onClose: () => void }) { + return ( +
+
+
e.stopPropagation()} + > + {/* Hero image */} + {item.images?.[0] && ( +
+ {item.name} +
+
+ + {getIcon(item.icon)} + +

+ {item.name} +

+
+
+ )} + + {/* Close button */} + + + {/* Content */} +
+ {item.detailedDescription && ( +
+ {formatMarkup(item.detailedDescription)} +
+ )} + {!item.detailedDescription && item.description && ( +

+ {item.description} +

+ )} +
+
+
+ ); +} diff --git a/src/components/sections/schedule/DayCard.tsx b/src/components/sections/schedule/DayCard.tsx index 9f95793..7623692 100644 --- a/src/components/sections/schedule/DayCard.tsx +++ b/src/components/sections/schedule/DayCard.tsx @@ -33,12 +33,12 @@ function ClassRow({ }) { return (
-
+
- + {cls.time}
-
+
{cls.status && (() => { const cfg = findStatusConfig(statuses, cls.status); return {cfg?.label || cls.status};