2022-05-04 18:45:30 +00:00
|
|
|
import { useState } from "react";
|
2022-04-04 09:11:24 +00:00
|
|
|
|
2022-05-04 18:45:30 +00:00
|
|
|
import { InstallAppButtonProps } from "../../types";
|
|
|
|
import AddIntegration from "./AccountDialog";
|
2022-04-04 09:11:24 +00:00
|
|
|
|
|
|
|
export default function InstallAppButton(props: InstallAppButtonProps) {
|
2022-05-04 18:45:30 +00:00
|
|
|
const [isModalOpen, setIsModalOpen] = useState(false);
|
2022-04-04 09:11:24 +00:00
|
|
|
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
{props.render({
|
|
|
|
onClick() {
|
2022-05-04 18:45:30 +00:00
|
|
|
setIsModalOpen(true);
|
2022-04-04 09:11:24 +00:00
|
|
|
},
|
2022-05-04 18:45:30 +00:00
|
|
|
disabled: isModalOpen,
|
2022-04-04 09:11:24 +00:00
|
|
|
})}
|
2022-05-04 18:45:30 +00:00
|
|
|
<AddIntegration open={isModalOpen} onOpenChange={setIsModalOpen} />
|
2022-04-04 09:11:24 +00:00
|
|
|
</>
|
|
|
|
);
|
|
|
|
}
|