Enable send to zulip

This commit is contained in:
2024-06-14 15:27:03 +02:00
parent a00fc3e657
commit 038da4f36c
2 changed files with 26 additions and 19 deletions

View File

@@ -2,21 +2,27 @@ import { useState } from "react";
import { featureEnabled } from "../domainContext";
import ShareModal from "./[transcriptId]/shareModal";
import { GetTranscript, GetTranscriptTopic } from "../../api";
import { Button } from "@chakra-ui/react";
import { BoxProps, Button } from "@chakra-ui/react";
type ShareZulipProps = {
transcriptResponse: GetTranscript;
topicsResponse: GetTranscriptTopic[];
disabled: boolean;
};
export default function ShareZulip(props: ShareZulipProps) {
export default function ShareZulip(props: ShareZulipProps & BoxProps) {
const [showModal, setShowModal] = useState(false);
if (!featureEnabled("sendToZulip")) return null;
return (
<>
<Button colorScheme="blue" onClick={() => setShowModal(true)}>
Zulip
<Button
colorScheme="blue"
size={"sm"}
isDisabled={props.disabled}
onClick={() => setShowModal(true)}
>
Send to Zulip
</Button>
<ShareModal