import { Dispatch, FC, SetStateAction } from 'react'; import dynamic from 'next/dynamic'; import { Skeleton } from 'antd'; import { ExternalAction } from '../../../interfaces/external-action'; import { ActionButtonMenu } from '../../action-buttons/ActionButtonMenu/ActionButtonMenu'; import { ActionButtonRow } from '../../action-buttons/ActionButtonRow/ActionButtonRow'; import { FollowButton } from '../../action-buttons/FollowButton'; import { NotifyButton } from '../../action-buttons/NotifyButton'; import styles from './Content.module.scss'; import { ActionButton } from '../../action-buttons/ActionButton/ActionButton'; interface ActionButtonProps { isMobile: boolean; supportFediverseFeatures: boolean; externalActions: ExternalAction[]; supportsBrowserNotifications: boolean; showNotifyReminder: any; setShowFollowModal: Dispatch>; setShowNotifyModal: Dispatch>; disableNotifyReminderPopup: () => void; setExternalActionToDisplay: any; externalActionSelected: (action: ExternalAction) => void; } const NotifyReminderPopup = dynamic( () => import('../NotifyReminderPopup/NotifyReminderPopup').then(mod => mod.NotifyReminderPopup), { ssr: false, loading: () => , }, ); const ActionButtons: FC = ({ isMobile, supportFediverseFeatures, supportsBrowserNotifications, showNotifyReminder, setShowFollowModal, setShowNotifyModal, disableNotifyReminderPopup, externalActions, setExternalActionToDisplay, externalActionSelected, }) => { const externalActionButtons = externalActions.map(action => ( )); if (!isMobile) { return ( {externalActionButtons} {supportFediverseFeatures && ( setShowFollowModal(true)} /> )} {supportsBrowserNotifications && ( setShowNotifyModal(true)} notificationClosed={() => disableNotifyReminderPopup()} > setShowNotifyModal(true)} /> )} ); } return (
setShowNotifyModal(true)} followItemSelected={() => setShowFollowModal(true)} />
); }; export default ActionButtons;