import React, { useState } from 'react'; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'; import { Input } from '@/components/ui/input'; import { Badge } from '@/components/ui/badge'; import { Search } from 'lucide-react'; import BinaryNumberGame from '@/components/BinaryNumberGame'; interface Interactive { id: string; title: string; description: string; tags: string[]; component: React.ComponentType; } const interactives: Interactive[] = [ { id: 'binary-number-game', title: 'Binary Number Representation', description: 'Learn binary representation by expressing numbers as sums of powers of two. Toggle cards to match the target sum!', tags: ['binary', 'math', 'numbers', 'representation', 'powers-of-two'], component: BinaryNumberGame, }, ]; const InteractiveGallery = () => { const [searchTerm, setSearchTerm] = useState(''); const [selectedInteractive, setSelectedInteractive] = useState(null); const filteredInteractives = interactives.filter(interactive => interactive.title.toLowerCase().includes(searchTerm.toLowerCase()) || interactive.description.toLowerCase().includes(searchTerm.toLowerCase()) || interactive.tags.some(tag => tag.toLowerCase().includes(searchTerm.toLowerCase())) ); if (selectedInteractive) { const InteractiveComponent = selectedInteractive.component; return (

{selectedInteractive.title}

); } return (

School Connect Interactives

Interactive tools and resources designed to connect theoretical concepts with practical applications in educational settings.

{/* Search bar */}
setSearchTerm(e.target.value)} className="pl-10" />
{/* Gallery */}
{filteredInteractives.map((interactive) => ( setSelectedInteractive(interactive)} > {interactive.title} {interactive.description}
{interactive.tags.map((tag) => ( {tag} ))}
))}
{filteredInteractives.length === 0 && (

No interactives found matching your search.

)}
); }; export default InteractiveGallery;