import classNames from 'clsx'; import React from 'react'; import { FormattedMessage } from 'react-intl'; import { spring } from 'react-motion'; import Icon from 'soapbox/components/icon'; import StatusContent from 'soapbox/components/status_content'; import { Stack } from 'soapbox/components/ui'; import AccountContainer from 'soapbox/containers/account_container'; import Motion from '../util/optional_motion'; import type { Menu, MenuItem } from 'soapbox/components/dropdown_menu'; import type { Status as StatusEntity } from 'soapbox/types/entities'; interface IActionsModal { status: StatusEntity, actions: Menu, onClick: () => void, onClose: () => void, } const ActionsModal: React.FC = ({ status, actions, onClick, onClose }) => { const renderAction = (action: MenuItem | null, i: number) => { if (action === null) { return
  • ; } const { icon = null, text, meta = null, active = false, href = '#', isLogout, destructive } = action; const Comp = href === '#' ? 'button' : 'a'; const compProps = href === '#' ? { onClick: onClick } : { href: href }; return (
  • {icon && }
    {text}
    {meta}
  • ); }; return ( {({ top }) => (
    {status && ( )}
      {actions && actions.map(renderAction)}
    )}
    ); }; export default ActionsModal;