File size: 728 Bytes
8a37e0a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import type { SetComparisonImageDndTargetData } from 'features/dnd/dnd';
import { setComparisonImageDndTarget } from 'features/dnd/dnd';
import { DndDropTarget } from 'features/dnd/DndDropTarget';
import { memo, useMemo } from 'react';
import { useTranslation } from 'react-i18next';

export const ImageComparisonDroppable = memo(() => {
  const { t } = useTranslation();
  const dndTargetData = useMemo<SetComparisonImageDndTargetData>(() => setComparisonImageDndTarget.getData(), []);

  return (
    <DndDropTarget
      dndTarget={setComparisonImageDndTarget}
      dndTargetData={dndTargetData}
      label={t('gallery.selectForCompare')}
    />
  );
});

ImageComparisonDroppable.displayName = 'ImageComparisonDroppable';