import React from 'react'; import { useDispatch } from 'react-redux'; import { openModal } from 'soapbox/actions/modals'; import Bundle from 'soapbox/features/ui/components/bundle'; import { MediaGallery } from 'soapbox/features/ui/util/async-components'; import type { List as ImmutableList } from 'immutable'; import type { Attachment } from 'soapbox/types/entities'; interface IAttachmentThumbs { media: ImmutableList onClick?(): void sensitive?: boolean } const AttachmentThumbs = (props: IAttachmentThumbs) => { const { media, onClick, sensitive } = props; const dispatch = useDispatch(); const renderLoading = () =>
; const onOpenMedia = (media: ImmutableList, index: number) => dispatch(openModal('MEDIA', { media, index })); return (
{(Component: any) => ( )} {onClick && (
)}
); }; export default AttachmentThumbs;