import React from 'react'; import { BookOpen, Check } from 'lucide-react'; import type { ModuleItem, PublicPlan, Currency } from '../../types'; interface CatalogSectionProps { curriculumModules: ModuleItem[]; publicPlans: PublicPlan[]; cart: ModuleItem[]; currency: Currency; isModuleUnlocked: (code: string) => boolean; getModulePrice: (item: ModuleItem) => { priceInr: number; priceUsd: number; priceEur: number; isActive: boolean; }; toggleCartItem: (module: ModuleItem) => void; showLockedByCategory: { [key: string]: boolean }; setShowLockedByCategory: React.Dispatch>; } export const CatalogSection: React.FC = ({ curriculumModules, publicPlans, cart, currency, isModuleUnlocked, getModulePrice, toggleCartItem, showLockedByCategory, setShowLockedByCategory, }) => { return (
Mobile App Curriculum Catalog

Unlock Professional TCM Modules

Unlock acupoint maps, organ syndrome references, and advanced dietetics. Entitling your login grants instant synchronization on your TCM iOS/Android app.

{/* 5 Premium Modules Structured Catalog */}
{/* CARD 1: Points Reference Module */}
Points
1-Year Access

Points Reference Module

Unlock high-definition acupuncture point mapping tables and clinical micro-systems.

{(() => { const items = curriculumModules.filter(m => m.category === 'Points'); const visible = items.filter(sub => { const isUnlocked = isModuleUnlocked(sub.code); const live = getModulePrice(sub); if (!isUnlocked && !live.isActive) return false; if (!isUnlocked && !showLockedByCategory.Points) return false; return true; }); if (visible.length === 0) { return (

Locked modules are currently hidden.

); } return visible.map((sub) => { const isUnlocked = isModuleUnlocked(sub.code); const isInCart = cart.some(item => item.code === sub.code); const live = getModulePrice(sub); return (
{ if (isUnlocked || !live.isActive) return; toggleCartItem(sub); }} className={`flex justify-between items-center p-3 rounded-2xl border transition-all duration-300 select-none ${ isUnlocked ? 'border-emerald-100 bg-emerald-50/20 cursor-default' : !live.isActive ? 'border-slate-100 bg-slate-50/50 opacity-60 cursor-not-allowed' : isInCart ? 'border-indigo-400 bg-indigo-50/20 shadow-sm cursor-pointer' : 'border-slate-100 bg-slate-50/80 hover:border-slate-300 cursor-pointer' }`} >
{sub.name.replace("Points: ", "")} {sub.code === 'POINTS_PACK' && ( Complete Pack )} {!isUnlocked && !live.isActive && ( Temporarily Unavailable )}

{sub.desc.replace(/1 Year:\s*/i, '')}

{isUnlocked ? ( UNLOCKED ) : !live.isActive ? ( INACTIVE ) : ( {currency === 'INR' ? `₹${live.priceInr}` : currency === 'EUR' ? `€${live.priceEur}` : `$${live.priceUsd}`} )} {!isUnlocked && live.isActive && (
{isInCart &&
}
)}
); }); })()}
{/* CARD 2: Pattern Diagnosis Module */}
Pattern
1-Year Access

Pattern Diagnosis Module

Full comprehensive study of professional TCM syndrome differentiation methodologies.

{(() => { const items = curriculumModules.filter(m => m.category === 'Pattern' || m.category === 'Patterns'); const visible = items.filter(sub => { const isUnlocked = isModuleUnlocked(sub.code); const live = getModulePrice(sub); if (!isUnlocked && !live.isActive) return false; if (!isUnlocked && !showLockedByCategory.Pattern) return false; return true; }); if (visible.length === 0) { return (

Locked modules are currently hidden.

); } return visible.map((sub) => { const isUnlocked = isModuleUnlocked(sub.code); const isInCart = cart.some(item => item.code === sub.code); const live = getModulePrice(sub); return (
{ if (isUnlocked || !live.isActive) return; toggleCartItem(sub); }} className={`flex justify-between items-center p-3 rounded-2xl border transition-all duration-300 select-none ${ isUnlocked ? 'border-emerald-100 bg-emerald-50/20 cursor-default' : !live.isActive ? 'border-slate-100 bg-slate-50/50 opacity-60 cursor-not-allowed' : isInCart ? 'border-indigo-400 bg-indigo-50/20 shadow-sm cursor-pointer' : 'border-slate-100 bg-slate-50/80 hover:border-slate-300 cursor-pointer' }`} >
{sub.name} {!isUnlocked && !live.isActive && ( Temporarily Unavailable )}

{sub.desc.replace(/1 Year:\s*/i, '')}

{isUnlocked ? ( UNLOCKED ) : !live.isActive ? ( INACTIVE ) : ( {currency === 'INR' ? `₹${live.priceInr}` : currency === 'EUR' ? `€${live.priceEur}` : `$${live.priceUsd}`} )} {!isUnlocked && live.isActive && (
{isInCart &&
}
)}
); }); })()}
{/* CARD 3: TCM Nutrition & Dietetics */}
Nutrition
1-Year Access

TCM Nutrition & Dietetics

Thermal nature, five-flavor dynamics, and clinical organ dietary prescriptions.

{(() => { const items = curriculumModules.filter(m => m.category === 'Nutrition'); const visible = items.filter(sub => { const isUnlocked = isModuleUnlocked(sub.code); const live = getModulePrice(sub); if (!isUnlocked && !live.isActive) return false; if (!isUnlocked && !showLockedByCategory.Nutrition) return false; return true; }); if (visible.length === 0) { return (

Locked modules are currently hidden.

); } return visible.map((sub) => { const isUnlocked = isModuleUnlocked(sub.code); const isInCart = cart.some(item => item.code === sub.code); const live = getModulePrice(sub); return (
{ if (isUnlocked || !live.isActive) return; toggleCartItem(sub); }} className={`flex justify-between items-center p-3 rounded-2xl border transition-all duration-300 select-none ${ isUnlocked ? 'border-emerald-100 bg-emerald-50/20 cursor-default' : !live.isActive ? 'border-slate-100 bg-slate-50/50 opacity-60 cursor-not-allowed' : isInCart ? 'border-indigo-400 bg-indigo-50/20 shadow-sm cursor-pointer' : 'border-slate-100 bg-slate-50/80 hover:border-slate-300 cursor-pointer' }`} >
{sub.name} {!isUnlocked && !live.isActive && ( Temporarily Unavailable )}

{sub.desc.replace(/1 Year:\s*/i, '')}

{isUnlocked ? ( UNLOCKED ) : !live.isActive ? ( INACTIVE ) : ( {currency === 'INR' ? `₹${live.priceInr}` : currency === 'EUR' ? `€${live.priceEur}` : `$${live.priceUsd}`} )} {!isUnlocked && live.isActive && (
{isInCart &&
}
)}
); }); })()}
{/* CARD 4: Clinical Therapeutics */}
Therapeutics
1-Year Access

Clinical Therapeutics

Master specific treatment modalities including Auricular Acupuncture and Gynaecology.

{(() => { const items = curriculumModules.filter(m => m.category === 'Therapeutics'); const visible = items.filter(sub => { const isUnlocked = isModuleUnlocked(sub.code); const live = getModulePrice(sub); if (!isUnlocked && !live.isActive) return false; if (!isUnlocked && !showLockedByCategory.Therapeutics) return false; return true; }); if (visible.length === 0) { return (

Locked modules are currently hidden.

); } return visible.map((sub) => { const isUnlocked = isModuleUnlocked(sub.code); const isInCart = cart.some(item => item.code === sub.code); const live = getModulePrice(sub); return (
{ if (isUnlocked || !live.isActive) return; toggleCartItem(sub); }} className={`flex justify-between items-center p-3 rounded-2xl border transition-all duration-300 select-none ${ isUnlocked ? 'border-emerald-100 bg-emerald-50/20 cursor-default' : !live.isActive ? 'border-slate-100 bg-slate-50/50 opacity-60 cursor-not-allowed' : isInCart ? 'border-indigo-400 bg-indigo-50/20 shadow-sm cursor-pointer' : 'border-slate-100 bg-slate-50/80 hover:border-slate-300 cursor-pointer' }`} >
{sub.name.replace("Therapeutics: ", "")} {sub.code === 'THERAPEUTICS_CORE' && ( Complete Pack )} {!isUnlocked && !live.isActive && ( Temporarily Unavailable )}

{sub.desc.replace(/1 Year:\s*/i, '')}

{isUnlocked ? ( UNLOCKED ) : !live.isActive ? ( INACTIVE ) : ( {currency === 'INR' ? `₹${live.priceInr}` : currency === 'EUR' ? `€${live.priceEur}` : `$${live.priceUsd}`} )} {!isUnlocked && live.isActive && (
{isInCart &&
}
)}
); }); })()}
{/* CARD 5: Lifetime Unlimited Pass */}
👑 Elite Access Suite

Lifetime Unlimited Access Pass

{(() => { const items = curriculumModules.filter(m => m.category === 'Lifetime'); const visible = items.filter(sub => { const isUnlocked = isModuleUnlocked(sub.code); const live = getModulePrice(sub); if (!isUnlocked && !live.isActive) return false; if (!isUnlocked && !showLockedByCategory.Lifetime) return false; return true; }); if (visible.length === 0) { return (

Locked pass is currently hidden.

); } return visible.map((sub) => { const isUnlocked = isModuleUnlocked(sub.code); const isInCart = cart.some(item => item.code === sub.code); const live = getModulePrice(sub); return (
{ if (isUnlocked || !live.isActive) return; toggleCartItem(sub); }} className={`flex justify-between items-center p-3 rounded-2xl border transition-all duration-300 select-none ${ isUnlocked ? 'border-emerald-100 bg-emerald-50/20 cursor-default' : !live.isActive ? 'border-amber-200/50 bg-amber-50/30 opacity-60 cursor-not-allowed' : isInCart ? 'border-indigo-400 bg-indigo-50/20 shadow-sm cursor-pointer' : 'border-slate-100 bg-slate-50/80 hover:border-slate-300 cursor-pointer' }`} >
{sub.name} {!isUnlocked && !live.isActive && ( Temporarily Unavailable )}

{sub.desc.replace(/10 Years:\s*/i, '')}

{isUnlocked ? ( UNLOCKED ) : !live.isActive ? ( INACTIVE ) : ( {currency === 'INR' ? `₹${live.priceInr}` : currency === 'EUR' ? `€${live.priceEur}` : `$${live.priceUsd}`} )} {!isUnlocked && live.isActive && (
{isInCart &&
}
)}
); }); })()}
{/* CARD 6: Custom Packages & Bundles (Dynamic Admin Plans) */} {(() => { const customPlans = publicPlans.filter((p: any) => { const code = p.base_code || p.code; const isCustom = !['POINTS_ACU', 'POINTS_SCALP', 'POINTS_EAR', 'POINTS_TUNG', 'POINTS_PACK', 'PATTERN_CORE', 'NUTRITION_CORE', 'THERAPEUTICS_GYNAE', 'THERAPEUTICS_EAR', 'THERAPEUTICS_CORE', 'LIFETIME_ALL'].includes(code); const isActive = p.is_active !== false; return isCustom && isActive; }); if (customPlans.length === 0) return null; const firstPlan = customPlans[0]; const headerBadge = firstPlan.badge_text || 'Custom Packages & Bundles'; const headerTitle = firstPlan.heading || 'Special Curated Bundles'; const headerSubtitle = firstPlan.subtitle || 'Custom curriculum collections created exclusively for practitioners.'; return (
{headerBadge} Custom Bundle

{headerTitle}

{headerSubtitle}

{customPlans.map((cPlan: any) => { const pCode = cPlan.base_code || cPlan.code; const isUnlocked = isModuleUnlocked(pCode); const isInCart = cart.some(item => item.code === pCode); const pInr = cPlan.price_inr ?? 0; const pUsd = cPlan.price_usd ?? 0; const customModuleItem: ModuleItem = { code: pCode, name: cPlan.name, category: 'Bundle', priceInr: pInr, priceUsd: pUsd, priceEur: pUsd, desc: cPlan.description || 'Custom bundled access.', color: 'from-slate-700 to-slate-900' }; return (
{ if (isUnlocked) return; toggleCartItem(customModuleItem); }} className={`flex justify-between items-center p-3 rounded-2xl border transition-all duration-300 select-none ${ isUnlocked ? 'border-emerald-100 bg-emerald-50/20 cursor-default' : isInCart ? 'border-indigo-400 bg-indigo-50/20 shadow-sm cursor-pointer' : 'border-slate-100 bg-slate-50/80 hover:border-slate-300 cursor-pointer' }`} >
{cPlan.name} {cPlan.badge_text && ( {cPlan.badge_text} )}
{cPlan.description && (

{cPlan.description}

)} {cPlan.modules && cPlan.modules.length > 0 && (
{cPlan.modules.map((m: any) => ( {m.name} ))}
)}
{isUnlocked ? ( UNLOCKED ) : ( {currency === 'INR' ? `₹${pInr}` : `$${pUsd}`} )} {!isUnlocked && (
{isInCart &&
}
)}
); })}
); })()}
); };