mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 04:46:40 +07:00
13 lines
384 B
TypeScript
13 lines
384 B
TypeScript
import { useCallback } from 'react';
|
|
import { IFile } from '~/redux/types';
|
|
import { modalShowPhotoswipe } from '~/redux/modal/actions';
|
|
import { useDispatch } from 'react-redux';
|
|
|
|
export const useImageModal = () => {
|
|
const dispatch = useDispatch();
|
|
|
|
return useCallback(
|
|
(images: IFile[], index: number) => dispatch(modalShowPhotoswipe(images, index)),
|
|
[dispatch]
|
|
);
|
|
};
|