mirror of
https://github.com/datahub-project/datahub.git
synced 2025-09-29 19:15:26 +00:00
32 lines
788 B
TypeScript
32 lines
788 B
TypeScript
![]() |
import React from 'react';
|
||
|
import styled from 'styled-components';
|
||
|
import { useEntityRegistry } from '../../../useEntityRegistry';
|
||
|
import { IconStyleType } from '../../Entity';
|
||
|
|
||
|
type Props = {
|
||
|
entity: any;
|
||
|
};
|
||
|
|
||
|
const Container = styled.div`
|
||
|
display: flex;
|
||
|
justify-content: left;
|
||
|
align-items: center;
|
||
|
padding: 12px;
|
||
|
`;
|
||
|
|
||
|
const IconContainer = styled.div`
|
||
|
margin-right: 8px;
|
||
|
`;
|
||
|
|
||
|
export const EntitySearchInputResult = ({ entity }: Props) => {
|
||
|
const entityRegistry = useEntityRegistry();
|
||
|
return (
|
||
|
<Container>
|
||
|
<IconContainer>{entityRegistry.getIcon(entity.type, 12, IconStyleType.ACCENT)}</IconContainer>
|
||
|
{entityRegistry.getDisplayName(entity.type, entity)}
|
||
|
</Container>
|
||
|
);
|
||
|
};
|
||
|
|
||
|
export default EntitySearchInputResult;
|