import { useMutation, useQuery } from "@tanstack/react-query";
import * as api from "../service/StickerService";
import { GroupStickersResponse } from "../types/Types";

export const useGetStickers = () => {
  return useQuery({
    queryKey: ["dpage-stickers"],
    queryFn: api.getStickers,
  });
};

export const useGetGroupStickers = () => {
  return useQuery<GroupStickersResponse>({
    queryKey: ["dpage-group-stickers"],
    queryFn: api.getGroupStickers,
  });
};

export const useCreateSticker = () => {
  return useMutation({
    mutationFn: api.createSticker,
  });
};

export const useDeleteSticker = () => {
  return useMutation({
    mutationFn: (id: string) => api.deleteSticker(id),
  });
};
