import { useMemo, useState } from "react" import { Modal, message } from "antd" import { CopyOutlined, FacebookFilled, LinkedinFilled, MediumCircleFilled, RedditCircleFilled, TwitchFilled, TwitterCircleFilled } from "@ant-design/icons" function Share({children, className=""}){ const [shareModalOpen, setShareModalOpen] = useState(false) const shareInfo = useMemo(() => { return { url: encodeURI("https://github.com/PaulleDemon/PyUIBuilder"), text: "Check out this GUI builder for python" } }, []) const onClick = () => { setShareModalOpen(true) } const onClose = (event) => { event.stopPropagation() setShareModalOpen(false) } const onCopy = (event) => { event.stopPropagation() navigator.clipboard.writeText(`Check out Font tester: ${shareInfo.url}`).then(function() { message.success("Link copied to clipboard") }, function(err) { message.error("Error copying to clipboard") }) } return (
{children} Share PyUI Builder with others} styles={{wrapper: {zIndex: 14000, gap: "10px"}}} onCancel={onClose} onOk={onClose} footer={null} open={shareModalOpen}>
) } export default Share