import { useFirestoreDataSource , DataSource , FetchCollectionProps , FetchEntityProps , Entity , SaveEntityProps , DeleteEntityProps , Property } from "@camberi/firecms" ; import { FirebaseApp } from "firebase/app" ; type CustomDataSourceProps = { firebaseApp ? : FirebaseApp ; } ; export function useCustomDatasource ( { firebaseApp } ) { const firestoreDataSource = useFirestoreDataSource ( { firebaseApp } ) ; return { fetchCollection < M > ( props ) { if ( props . path === "your_path_custom" ) { } return firestoreDataSource . fetchCollection ( props ) ; } , fetchEntity < M > ( props ) { if ( props . path === "your_path_custom" ) { } return firestoreDataSource . fetchEntity ( props ) ; } , saveEntity < M > ( props ) { if ( props . path === "your_path_custom" ) { } return firestoreDataSource . saveEntity ( props ) ; } , deleteEntity < M > ( props ) { return firestoreDataSource . deleteEntity ( props ) ; } , checkUniqueField ( path , name , value , property , entityId ? ) { return firestoreDataSource . checkUniqueField ( path , name , value , property , entityId ) ; } } ; }