export function usePagesService() {
  const { apiFetch } = useApi()

  return {
    getAbout() {
      return apiFetch('/about')
    },

    getHowItWorks() {
      return apiFetch('/static/how-it-works')
    },

    getFaqs() {
      return apiFetch('/faqs')
    },

    sendInvite(form: Record<string, unknown>) {
      return apiFetch('/invites', { method: 'POST', body: form })
    },

    sendContactMessage(formData: Record<string, unknown>) {
      return apiFetch('/contact-us', { method: 'POST', body: formData })
    },

    getContactTypes() {
      return apiFetch('/contact-types')
    },

    getSellWithUs() {
      return apiFetch('/static/sell-with-us')
    },

    getTerms() {
      return apiFetch('/static-pages/terms')
    },

    getPrivacy() {
      return apiFetch('/static-pages/privacy')
    },

    getVendors() {
      return apiFetch('/vendors')
    },

    getCategories(page: number) {
      return apiFetch('/categories', { query: { page } })
    },

    getCategoryById(id: number) {
      return apiFetch(`/categories/${id}`)
    },

    getCountries() {
      return apiFetch('/countries')
    },

    getTransactions(perPage: number, page: number) {
      return apiFetch('/users/wallet/transactions', { query: { per_page: perPage, page } })
    },

    getSocials() {
      return apiFetch('/socials')
    },

    getBranches(companyId: number) {
      return apiFetch(`/companies/profile/${companyId}`)
    },

    getDataTable(type: string) {
      return apiFetch('/admin/deals/29478/auto-match', { query: { type } })
    },
  }
}
