"use client" import { useState, useEffect, useRef } from "react" import { ContentHeader } from "@/components/custom/content-header" import { PiLinkSimple } from "react-icons/pi" import { Bookmark, GraduationCap, Check } from "lucide-react" interface LinkProps { title: string url: string } const links = [ { title: "JavaScript", url: "https://justjavascript.com" }, { title: "TypeScript", url: "https://www.typescriptlang.org/" }, { title: "React", url: "https://reactjs.org/" } ] const LinkItem: React.FC = ({ title, url }) => (

{title}

{new URL(url).hostname}
) interface ButtonProps { children: React.ReactNode onClick: () => void className?: string color?: string icon?: React.ReactNode fullWidth?: boolean } const Button: React.FC = ({ children, onClick, className = "", color = "", icon, fullWidth = false }) => { return ( ) } export default function GlobalTopic({ topic }: { topic: string }) { const [showOptions, setShowOptions] = useState(false) const [selectedOption, setSelectedOption] = useState(null) const [activeTab, setActiveTab] = useState("Guide") const decodedTopic = decodeURIComponent(topic) const learningStatusRef = useRef(null) useEffect(() => { function handleClickOutside(event: MouseEvent) { if (learningStatusRef.current && !learningStatusRef.current.contains(event.target as Node)) { setShowOptions(false) } } document.addEventListener("mousedown", handleClickOutside) return () => { document.removeEventListener("mousedown", handleClickOutside) } }, []) const learningOptions = [ { text: "To Learn", icon: }, { text: "Learning", icon: }, { text: "Learned", icon: } ] const learningStatusColor = (option: string) => { switch (option) { case "To Learn": return "text-white/70" case "Learning": return "text-[#D29752]" case "Learned": return "text-[#708F51]" default: return "text-white/70" } } const selectedStatus = (option: string) => { setSelectedOption(option) setShowOptions(false) } return (

{decodedTopic}

{showOptions && (
{learningOptions.map(option => ( ))}
)}

Intro

{links.map((link, index) => ( ))}

Other

{links.map((link, index) => ( ))}
) }