import { useModalStore } from '@/stores/modalStore';
import type { ModalName } from '@/types/enums';
import type { ModalContent, ModalSettings } from '@/types/models';

export const useModal = () => {
	const modalStore = useModalStore();

	const openModal = (name: ModalName, data?: ModalContent, settings?: ModalSettings) => {
		modalStore.openModal(name, data, settings);
	};

	const closeModal = () => modalStore.closeModal();

	return { openModal, closeModal };
};
