import { createAsyncThunk } from '@reduxjs/toolkit'; import { getLeadsApi } from '@api'; import { LeadItem } from '@interfaces'; export const getLeads = createAsyncThunk< LeadItem[], { leadId: string | null; staffid: string } >('leads/getLeads', async (payload, { rejectWithValue }) => { try { return await getLeadsApi(payload.leadId, payload.staffid); } catch (error: any) { return rejectWithValue(error.message || 'Failed to load leads'); } });