{"version":3,"file":"EntityView.cjs","sources":["../../../../../packages/react-binding/src/helperComponents/EntityView.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { useEntity } from '../accessorPropagation'\nimport type { EntityAccessor } from '@contember/binding'\nimport type { SugaredRelativeSingleEntity } from '@contember/binding'\n\nexport interface EntityViewProps {\n\trender: (entity: EntityAccessor) => ReactNode\n\tfield?: string | SugaredRelativeSingleEntity\n}\n\n/**\n * @group Data binding\n */\nexport function EntityView(props: EntityViewProps) {\n\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\tconst entity = 'field' in props ? useEntity(props.field)! : useEntity()\n\n\treturn <>{props.render(entity)}</>\n}\n"],"names":["useEntity","jsx","Fragment"],"mappings":";;;;AAaO,SAAS,WAAW,OAAwB;AAElD,QAAM,SAAS,WAAW,QAAQA,oBAAU,MAAM,KAAK,IAAKA,oBAAU;AAEtE,SAAUC,2BAAAA,IAAAC,WAAAA,UAAA,EAAA,UAAA,MAAM,OAAO,MAAM,GAAE;AAChC;;"}