import { api } from '../api/client'

export type MemberCapabilitiesData = {
  discover_ready: boolean
  ai_ready: boolean
  publish_ready: boolean
  discover_hint?: string
  ai_hint?: string
  publish_hint?: string
  active_threads_account_id?: string
}

export async function fetchMemberCapabilities(): Promise<MemberCapabilitiesData> {
  return api.get<MemberCapabilitiesData>('/api/v1/members/me/capabilities', { auth: true })
}

export function connectionsSettingsPath(activeAccountId?: string) {
  const id = activeAccountId?.trim()
  return id ? `/threads/${encodeURIComponent(id)}/connections` : '/settings'
}