import { apiClient } from './client'

export interface BrandingInfo {
  company_display_name: string | null
  logo_content_type: string | null
  has_logo: boolean
}

export async function getBranding(teamId: string): Promise<BrandingInfo> {
  const response = await apiClient.get(`/teams/${teamId}/branding`)
  return response.data
}

export async function updateBranding(teamId: string, formData: FormData): Promise<BrandingInfo> {
  const response = await apiClient.patch(`/teams/${teamId}/branding`, formData, {
    headers: { 'Content-Type': 'multipart/form-data' },
  })
  return response.data
}

export async function deleteLogo(teamId: string): Promise<void> {
  await apiClient.delete(`/teams/${teamId}/branding/logo`)
}
