2025-01-29 20:42:01 -05:00
|
|
|
import React from 'react';
|
|
|
|
import styled from 'styled-components';
|
2025-04-16 16:55:38 -07:00
|
|
|
|
|
|
|
import { IconStyleType } from '@app/entityV2/Entity';
|
|
|
|
import { useEntityRegistry } from '@app/useEntityRegistry';
|
2025-01-29 20:42:01 -05:00
|
|
|
|
|
|
|
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;
|