2025-07-03 00:42:58 +03:00
|
|
|
import React from 'react';
|
|
|
|
|
import { Link } from 'react-router-dom';
|
|
|
|
|
|
|
|
|
|
import AutoCompleteEntityItem from '@app/searchV2/autoCompleteV2/AutoCompleteEntityItem';
|
|
|
|
|
import { useEntityRegistryV2 } from '@app/useEntityRegistry';
|
|
|
|
|
|
|
|
|
|
import { Entity } from '@types';
|
|
|
|
|
|
|
|
|
|
interface Props {
|
|
|
|
|
entity: Entity;
|
2025-07-14 00:51:18 +05:30
|
|
|
customDetailsRenderer?: (entity: Entity) => void;
|
2025-07-03 00:42:58 +03:00
|
|
|
}
|
|
|
|
|
|
2025-07-14 00:51:18 +05:30
|
|
|
export default function EntityItem({ entity, customDetailsRenderer }: Props) {
|
2025-07-03 00:42:58 +03:00
|
|
|
const entityRegistry = useEntityRegistryV2();
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<Link to={entityRegistry.getEntityUrl(entity.type, entity.urn)}>
|
2025-07-14 00:51:18 +05:30
|
|
|
<AutoCompleteEntityItem entity={entity} key={entity.urn} customDetailsRenderer={customDetailsRenderer} />
|
2025-07-03 00:42:58 +03:00
|
|
|
</Link>
|
|
|
|
|
);
|
|
|
|
|
}
|