Skip to content

Commit 9fca9e3

Browse files
committed
Unify title between Tile and Modal
Signed-off-by: Trung Nguyen <[email protected]>
1 parent 534ac4b commit 9fca9e3

File tree

1 file changed

+11
-1
lines changed
  • src/extension/ui/src/components/tile

1 file changed

+11
-1
lines changed

src/extension/ui/src/components/tile/Modal.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ import {
2525
Typography,
2626
useTheme,
2727
} from '@mui/material';
28+
import { capitalize } from 'lodash-es';
2829
import { useEffect, useState } from 'react';
30+
2931
import { ASSIGNED_SECRET_PLACEHOLDER, MCP_POLICY_NAME } from '../../Constants';
3032
import { useCatalogOperations } from '../../queries/useCatalog';
3133
import { useConfig } from '../../queries/useConfig';
@@ -152,7 +154,15 @@ const ConfigurationModal = ({
152154
borderRadius: 1,
153155
}}
154156
/>
155-
{catalogItem.name}
157+
{
158+
// Lodash doesn't have a capitalize function that works with strings
159+
catalogItem.name
160+
.replace(/-/g, ' ')
161+
.replace(/_/g, ' ')
162+
.split(' ')
163+
.map(capitalize)
164+
.join(' ')
165+
}
156166

157167
<Tooltip
158168
placement="right"

0 commit comments

Comments
 (0)