import { MapPin } from "lucide-react"; import { shortAddress } from "@/components/sections/schedule/constants"; import { ScheduleBadge } from "@/components/ui/ScheduleBadge"; export interface GroupCardSlot { days: string[]; times: string[]; } export interface GroupCardProps { type: string; level?: string; recruiting?: boolean; hasSlots?: boolean; status?: string; statusLabel?: string; address?: string; location?: string; merged: GroupCardSlot[]; dotColor?: string; /** Compact mode for small cards (e.g. trainer bio scroll row) */ compact?: boolean; /** Show location badge */ showLocation?: boolean; /** Extra badges (e.g. "Сегодня") rendered after level badge */ extraBadges?: React.ReactNode; /** Click handler for type name (e.g. filter toggle in schedule) */ onTypeClick?: () => void; /** Click handler for book button */ onBook?: () => void; } export function GroupCard({ type, level, recruiting, hasSlots, status, statusLabel, address, location, merged, dotColor = "bg-gold", compact = false, showLocation = true, extraBadges, onTypeClick, onBook, }: GroupCardProps) { const dot = compact ? "h-2 w-2" : "h-2.5 w-2.5"; const typeCls = compact ? "text-xs" : "text-sm"; const dayPad = compact ? "px-1.5 py-px text-[10px] min-w-[40px]" : "px-2 py-0.5 text-[11px] min-w-[52px]"; const timeCls = compact ? "text-xs" : "text-sm font-medium"; const locSize = compact ? "px-2 py-0.5 text-[9px]" : "px-2.5 py-0.5 text-[10px]"; const locIcon = compact ? 8 : 9; const levelBadge = level ? ( {level} ) : null; const typeContent = ( <> {type} ); return (
{/* Type + address + level + status badges */}
{onTypeClick ? ( ) : ( {typeContent} )} {showLocation && (address || location) && ( {shortAddress(address || location || "")} )} {status && ( {statusLabel || status} )} {levelBadge} {extraBadges}
{/* Schedule rows */}
{merged.map((m, i) => (
{m.days.join(", ")} {m.times.join(", ")}
))}
{/* Book button */} {onBook && ( compact ? ( ) : null )}
); }