import { api } from './api';
import type { Banner } from '../types/banner.types';
interface Resp<T> { success: boolean; data: T; }
export const bannerApi = {
  getActive: () => api.get<Resp<Banner[]>>('/api/banners/active').then(r => r.data.data),
  getAll: () => api.get<Resp<Banner[]>>('/api/banners').then(r => r.data.data),
  create: (data: Omit<Banner, 'id'|'created_at'>) => api.post<Resp<Banner>>('/api/banners', data).then(r => r.data.data),
  delete: (id: string) => api.delete(`/api/banners/${id}`).then(() => undefined),
};
