import { AnimateSlideDown, Dropdown, DropdownItem, DropdownSeparator, IconLoading, location, MeatballMenu } from "@heydovetail/ui-components"; import React from "react"; import { AttachmentService } from "../../AttachmentService"; import { Attachment } from "../../util/attrs"; import { AttachmentDownloadUrlSubscribe } from "./AttachmentDownloadUrlSubscribe"; import { AttachmentInfoDropdown } from "./AttachmentInfoDropdown"; interface Props { attachment: Attachment; attachmentService: AttachmentService; editable: boolean; hasPreview: boolean; menuAlign?: "left" | "right"; onHidePreview?: () => void; onMenuToggle?: (open: boolean) => void; onRemove: () => void; onShowPreview?: () => void; } export function AttachmentActions(props: Props) { const { menuAlign = "right" } = props; const { hidePreview } = props.attachment; return ( {({ dismiss, push }) => ( {(attachmentDownloadUrl): React.ReactNode => { const value = "Open"; switch (attachmentDownloadUrl.type) { case "pending": case "unavailable": return ; case "refreshing": return } />; case "available": return ( ); } }} {props.hasPreview ? ( hidePreview ? ( ) : ( ) ) : null} push( ) } /> )} ); }