customization of labels title & defualt to Labels

Signed-off-by: Brian Fletcher <brian@roadie.io>
This commit is contained in:
Brian Fletcher
2023-01-12 09:16:19 +00:00
parent 9ef778c4b5
commit ef8e6b0386
2 changed files with 5 additions and 2 deletions
+2
View File
@@ -282,6 +282,8 @@ export const EntityLabelsCard: (props: EntityLabelsCardProps) => JSX.Element;
// @public (undocumented)
export interface EntityLabelsCardProps {
// (undocumented)
title?: string;
// (undocumented)
variant?: InfoCardVariants;
}
@@ -28,6 +28,7 @@ import { makeStyles, Typography } from '@material-ui/core';
/** @public */
export interface EntityLabelsCardProps {
variant?: InfoCardVariants;
title?: string;
}
const useStyles = makeStyles(_ => ({
@@ -37,7 +38,7 @@ const useStyles = makeStyles(_ => ({
}));
export const EntityLabelsCard = (props: EntityLabelsCardProps) => {
const { variant } = props;
const { variant, title } = props;
const { entity } = useEntity();
const classes = useStyles();
@@ -59,7 +60,7 @@ export const EntityLabelsCard = (props: EntityLabelsCardProps) => {
const labels = entity?.metadata?.labels;
return (
<InfoCard title="Entity Labels" variant={variant}>
<InfoCard title={title || 'Labels'} variant={variant}>
{!labels || Object.keys(labels).length === 0 ? (
<EntityLabelsEmptyState />
) : (