import type {Id} from '../@types/index.d.ts'; import type { RemoteRowProps, RemoteRowView as RemoteRowViewDecl, } from '../@types/ui-react/index.d.ts'; import {isUndefined} from '../common/other.ts'; import {getProps, getRelationshipsStoreTableIds} from '../common/react.ts'; import {Wrap} from './common/Wrap.tsx'; import {useRelationshipsOrRelationshipsById, useRemoteRowId} from './hooks.ts'; import {RowView} from './RowView.tsx'; export const RemoteRowView: typeof RemoteRowViewDecl = ({ relationshipId, localRowId, relationships, rowComponent: Row = RowView, getRowComponentProps, debugIds, }: RemoteRowProps): any => { const [resolvedRelationships, store, , remoteTableId] = getRelationshipsStoreTableIds( useRelationshipsOrRelationshipsById(relationships), relationshipId, ); const rowId = useRemoteRowId( relationshipId, localRowId, resolvedRelationships, ); return ( {isUndefined(remoteTableId) || isUndefined(rowId) ? null : ( )} ); };