import apiClient from './client'; export interface ProjectTitleItem { id: string; workspace_id: string; project_id: string; text: string; category: 'default' | 'marketing' | 'tutorial' | 'story' | 'promo'; favorite: boolean; usage_count: number; is_active: boolean; created_at: string; updated_at: string; } export const getProjectTitles = async (projectId: string, activeOnly = false): Promise => { const response = await apiClient.get(`/projects/${projectId}/titles`, { params: { active_only: activeOnly } }); return response.data.items; }; export const createProjectTitle = async (projectId: string, data: { workspace_id: string; text: string; category?: ProjectTitleItem['category']; favorite?: boolean }): Promise => { const response = await apiClient.post(`/projects/${projectId}/titles`, data); return response.data; }; export const updateProjectTitle = async (titleId: string, data: { text?: string; category?: ProjectTitleItem['category']; favorite?: boolean; is_active?: boolean }): Promise => { const response = await apiClient.patch(`/project-titles/${titleId}`, data); return response.data; };