// src/store/useNewsStore.ts
import { create } from "zustand";

interface NewsData {
  title: string;
  desc: string;
  title_ru: string;
  desc_ru: string;
  category: number | null;
  banner: File | undefined | string;
}

interface NewsStore {
  stepOneData: NewsData;
  setStepOneData: (data: NewsData) => void;
  resetStepOneData: () => void;
}

export const useNewsStore = create<NewsStore>((set) => ({
  stepOneData: {
    title: "",
    desc: "",
    category: null,
    banner: undefined,
    desc_ru: "",
    title_ru: "",
  },
  setStepOneData: (data) => set({ stepOneData: data }),
  resetStepOneData: () =>
    set({
      stepOneData: {
        title: "",
        desc: "",
        category: null,
        banner: undefined,
        desc_ru: "",
        title_ru: "",
      },
    }),
}));
