import { Post } from "@shared/composer/types/post"; import { User } from "@shared/composer/user"; import CancelIcon from "@icons/cancel"; import ChevronDownIcon from "@icons/chevronDown"; import ChevronRightIcon from "@icons/chevronRight"; import ComposeIcon from "@icons/compose"; import { composerAtom } from "@stores/composer"; import { useActiveAccount } from "@utils/hooks/useActiveAccount"; import { Dialog, Transition } from "@headlessui/react"; import { useAtom } from "jotai"; import { Fragment, useState } from "react"; export function ComposerModal() { const [isOpen, setIsOpen] = useState(false); const [composer] = useAtom(composerAtom); const { account, isLoading, isError } = useActiveAccount(); const closeModal = () => { setIsOpen(false); }; const openModal = () => { setIsOpen(true); }; return ( <> openModal()} className="inline-flex h-8 w-max items-center justify-center gap-1 rounded-md bg-fuchsia-500 px-2.5 text-sm font-medium text-white shadow-button hover:bg-fuchsia-600 focus:outline-none" > Compose {!isLoading && !isError && account && ( )} New Post {composer.type === "post" && account && ( )} > ); }