import apiClient from "@/lib/axiosClient";
import { API_ENDPOINTS } from "@/lib/apiEndpoints";

export interface OnboardingSlide {
  id: number;
  title: string;
  description: string;
  image: string;
}

export const onboardingService = {
  getSlides: (): Promise<OnboardingSlide[]> =>
    apiClient
      .post(API_ENDPOINTS.GET_ONBOARDING_SCREEN, {})
      .then((r) => (r.data?.result ?? []).filter((s: OnboardingSlide & { status?: number }) => s.status === 1))
      .catch(() => []),
};
