diff --git a/src/pages/theme-pages/discrete-math/Foundations.tsx b/src/pages/theme-pages/discrete-math/Foundations.tsx index b3230b4..35260c3 100644 --- a/src/pages/theme-pages/discrete-math/Foundations.tsx +++ b/src/pages/theme-pages/discrete-math/Foundations.tsx @@ -4,7 +4,6 @@ import { Search } from "lucide-react"; import Layout from "@/components/Layout"; import InteractiveCard from "@/components/InteractiveCard"; import BinaryNumberGame from "@/components/BinaryNumberGame"; - interface Interactive { id: string; title: string; @@ -13,72 +12,41 @@ interface Interactive { component: React.ComponentType; greenScreenPath: string; } - -const interactives: Interactive[] = [ - { - id: "binary-number-game", - title: "Binary Number Representation", - description: "Learn how numbers are represented in binary (base-2) format through an interactive guessing game.", - tags: ["binary", "numbers", "conversion", "representation"], - component: BinaryNumberGame, - greenScreenPath: "/binary-number-game", - }, -]; - +const interactives: Interactive[] = [{ + id: "binary-number-game", + title: "Binary Number Representation", + description: "Learn how numbers are represented in binary (base-2) format through an interactive guessing game.", + tags: ["binary", "numbers", "conversion", "representation"], + component: BinaryNumberGame, + greenScreenPath: "/binary-number-game" +}]; const Foundations = () => { 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()) - ) - ); - + 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 ( -
+ return
- -

{selectedInteractive.title}

- + + Back to Discrete Math →
- +
-
- ); +
; } - - return ( - + return
- + ← Back to Discrete Math

Foundations

@@ -86,38 +54,20 @@ const Foundations = () => {
- setSearchTerm(e.target.value)} - className="w-full pl-10 pr-4 py-2 border border-outline rounded-md bg-background text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent" - /> + setSearchTerm(e.target.value)} className="w-full pl-10 pr-4 py-2 border border-outline rounded-md bg-background text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent" />
- {filteredInteractives.map((interactive) => ( - setSelectedInteractive(interactive)} - /> - ))} + {filteredInteractives.map(interactive => setSelectedInteractive(interactive)} />)}
- {filteredInteractives.length === 0 && ( -
+ {filteredInteractives.length === 0 &&

No interactives found matching "{searchTerm}"

-
- )} +
}
- - ); + ; }; - export default Foundations; \ No newline at end of file