'use client'

import type { IBaseResponse } from '@/@core/types/api'
import { request } from '@/utils'
import { useCustomMutation } from '@/hooks/api'

export type UploadTransactionProofPayload = {
  transaction_id: string
  proof_image: string
  sender_info?: string
  notes?: string
}

export const useUploadTransactionProof = () => {
  return useCustomMutation<UploadTransactionProofPayload, IBaseResponse<any>>(
    ['transactions-upload-proof'],
    ({ transaction_id, ...payload }) =>
      request({
        url: `/transactions/${transaction_id}/upload-proof`,
        method: 'POST',
        data: payload,
        withToken: false
      })
  )
}
