import { create } from "zustand";

interface State {
	isOpened: boolean;
	title: string;
	base64: string;

	open: (title: string, base64: string) => void;
	close: () => void;
}

export const usePhotoCardSlice = create<State>((set) => ({
	isOpened: false,
	title: "",
	base64: "",

	open: (title, base64) =>
		set(() => ({
			isOpened: true,
			title,
			base64,
		})),

	close: () =>
		set(() => ({
			isOpened: false,
			title: "",
			base64: "",
		})),
}));
