import { API_URL } from "@/lib/config/env";
import axios from "axios";

const axiosInstance = axios.create({
  baseURL: API_URL,
  timeout: 50000,
  headers: {
    Accept: "application/json",
    "Content-Type": "multipart/form-data",
  },
});

axiosInstance.interceptors.request.use((config) => {
  const token = localStorage.getItem("token");
  if (token) {
    config.headers.Authorization = `Bearer ${token}`;
  }
  return config;
});

export default axiosInstance;
