1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-09-24 17:51:14 +02:00
unleash.unleash/frontend/src/component/environments/EnvironmentNameCell/EnvironmentNameCell.tsx
Nuno Góis b61980e71b feat: Admin project roles table (#1030)
* feat: new admin project roles table

* small fixes

* replace Box in defaultColumn Cell with the new TextCell

* refactor: slight adjustments

* misc improvements

* add HighlightCell

* fix: description width

* Update src/component/admin/projectRoles/ProjectRoles/ProjectRoleList/ProjectRoleList.tsx

Co-authored-by: Tymoteusz Czech <2625371+Tymek@users.noreply.github.com>

* address PR comments, small tooltip fixes

* fix: prettier fmt

Co-authored-by: Tymoteusz Czech <2625371+Tymek@users.noreply.github.com>
2022-05-26 15:27:20 +01:00

27 lines
1022 B
TypeScript

import { TextCell } from 'component/common/Table/cells/TextCell/TextCell';
import { IEnvironment } from 'interfaces/environments';
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
import { StatusBadge } from 'component/common/StatusBadge/StatusBadge';
import { Highlighter } from 'component/common/Highlighter/Highlighter';
import { useSearchHighlightContext } from 'component/common/Table/SearchHighlightContext/SearchHighlightContext';
interface IEnvironmentNameCellProps {
environment: IEnvironment;
}
export const EnvironmentNameCell = ({
environment,
}: IEnvironmentNameCellProps) => {
const { searchQuery } = useSearchHighlightContext();
return (
<TextCell>
<Highlighter search={searchQuery}>{environment.name}</Highlighter>
<ConditionallyRender
condition={!environment.enabled}
show={<StatusBadge severity="warning">Disabled</StatusBadge>}
/>
</TextCell>
);
};