import topics from "@/resources/topics"; import {useState} from "react"; import {BsArrowLeft, BsArrowRight} from "react-icons/bs"; import Button from "../Low/Button"; import Modal from "../Modal"; interface Props { isOpen: boolean; initialTopics: string[]; onClose: VoidFunction; selectTopics: (topics: string[]) => void; } export default function TopicModal({isOpen, initialTopics, onClose, selectTopics}: Props) { const [selectedTopics, setSelectedTopics] = useState([...initialTopics]); return (
Available Topics
{topics .filter((x) => !selectedTopics.includes(x)) .map((x) => (
{x}
))}
Preferred Topics ({selectedTopics.length || "All"})
{selectedTopics.map((x) => (
{x}
))}
); }