import React, { useState, useEffect } from "react"; import SelectSearch from "react-select-search"; type ShareModal = { show: boolean; setShow: (show: boolean) => void; title: string; url: string; summary: string; }; const ShareModal = (props: ShareModal) => { const [stream, setStream] = useState(null); const [topic, setTopic] = useState(null); const [includeTranscript, setIncludeTranscript] = useState(false); const [includeSummary, setIncludeSummary] = useState(false); const [includeTopics, setIncludeTopics] = useState(false); const [isLoading, setIsLoading] = useState(true); const [streams, setStreams] = useState({}); useEffect(() => { fetch("/streams.json") .then((response) => { if (!response.ok) { throw new Error("Network response was not ok"); } return response.json(); }) .then((data) => { console.log("Stream data:", data); setStreams(data); setIsLoading(false); // data now contains the JavaScript object decoded from JSON }) .catch((error) => { console.error("There was a problem with your fetch operation:", error); }); }, []); const handleSendToZulip = () => { const message = `### Reflector Recording\n\n**[${props.title}](${props.url})**\n\n${props.summary}`; alert("Send to zulip"); }; if (props.show && isLoading) { return
Loading...
; } return (
{props.show && (
{/* */}
)}
); }; export default ShareModal;