Files
reflector/www/app/[domain]/transcripts/shareZulip.tsx
2024-01-25 13:59:47 +01:00

31 lines
835 B
TypeScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { useState } from "react";
import { featureEnabled } from "../domainContext";
import ShareModal from "./[transcriptId]/shareModal";
import { GetTranscript, GetTranscriptTopic } from "../../api";
import { Button } from "@chakra-ui/react";
type ShareZulipProps = {
transcriptResponse: GetTranscript;
topicsResponse: GetTranscriptTopic[];
};
export default function ShareZulip(props: ShareZulipProps) {
const [showModal, setShowModal] = useState(false);
if (!featureEnabled("sendToZulip")) return null;
return (
<>
<Button colorScheme="blue" onClick={() => setShowModal(true)}>
Zulip
</Button>
<ShareModal
transcript={props.transcriptResponse}
topics={props.topicsResponse}
show={showModal}
setShow={(v) => setShowModal(v)}
/>
</>
);
}