cal.pub0.org/packages/app-store/caldavcalendar/components/InstallAppButton.tsx

21 lines
500 B
TypeScript

import { useState } from "react";
import { InstallAppButtonProps } from "../../types";
import AddIntegration from "./AddIntegration";
export default function InstallAppButton(props: InstallAppButtonProps) {
const [isModalOpen, setIsModalOpen] = useState(false);
return (
<>
{props.render({
onClick() {
setIsModalOpen(true);
},
disabled: isModalOpen,
})}
<AddIntegration open={isModalOpen} onOpenChange={setIsModalOpen} />
</>
);
}