import { useApi } from './useApi'
import type { ApiActivity } from '@/types/activity'

// 활동 피드 API Composable — 인터셉터가 success/data 를 언래핑
export function useActivity() {
  const api = useApi()

  // 프로젝트 활동 피드(최신순)
  async function list(projectId: string): Promise<ApiActivity[]> {
    return (await api.get(`/projects/${projectId}/activity`)) as unknown as ApiActivity[]
  }

  return { list }
}
