'use client'; import Reveal from './Reveal'; import { EnterpriseUseCases, UseCaseItem } from '../types'; import Image from 'next/image'; export default function UseCases({ useCases, headless, badgeId }: { useCases?: EnterpriseUseCases | null; headless?: boolean; badgeId?: string }) { if (!useCases || !Array.isArray(useCases.items) || useCases.items.length === 0) return null; const items: UseCaseItem[] = useCases.items.slice(0, 4); const note = (useCases.note || '').trim(); // Generate unique indices (1-9) for each use case, ensuring no repeats const usedIndices = new Set(); const getUniqueIndex = (idx: number) => { const seed = `${badgeId || ''}|${idx}`; let hash = 0; for (let i = 0; i < seed.length; i++) { hash = (hash * 31 + seed.charCodeAt(i)) >>> 0; } let baseIndex = (hash % 9) + 1; // If base index is already used, find next available let finalIndex = baseIndex; let attempts = 0; while (usedIndices.has(finalIndex) && attempts < 9) { finalIndex = ((finalIndex) % 9) + 1; attempts++; } usedIndices.add(finalIndex); return finalIndex; }; return (

Project Capabilities

{items.map((uc, idx) => { const imgIndex = getUniqueIndex(idx); const imgSrc = `/badge/puzzle${imgIndex}.svg`; return (
{''}
{uc.title}
{uc.potential_impact ? (
Potential Impact: {uc.potential_impact}
) : null} {uc.demonstrated_capability ? (
Demonstrated Capability: {uc.demonstrated_capability}
) : null} {uc.justification ? (
Justification: {uc.justification}
) : null}
);})}
{note ? (
{note}
) : null}
); }