ultisuite-client/lib/contacts/use-contacts-list.ts
R3D347HR4Y 8a02c10ba3 Add environment configuration and update email view components
- Created a .cursorignore file to manage local environment files.
- Updated .env.example to reflect changes in the public app URL.
- Modified the gmail workspace configuration to include the drive-suite path.
- Enhanced email view components to support attachment handling and fallback for plain text bodies.
- Improved user experience by updating attachment display logic and integrating inline attachment support.
2026-06-04 00:12:43 +02:00

20 lines
589 B
TypeScript

'use client'
import { useMemo } from 'react'
import {
useContacts,
useDefaultContactBookId,
} from '@/lib/api/hooks/use-contact-queries'
import { apiContactToFullContact } from '@/lib/api/adapters'
export function useContactsList(bookId?: string) {
const defaultBookId = useDefaultContactBookId()
const resolvedBookId = bookId ?? defaultBookId
const { data: apiContacts, ...rest } = useContacts(resolvedBookId)
const contacts = useMemo(
() => apiContacts?.map(apiContactToFullContact) ?? [],
[apiContacts]
)
return { contacts, bookId: resolvedBookId, ...rest }
}