From 2d7e787ea1f1af627ef8f8b883d65af7d8945d57 Mon Sep 17 00:00:00 2001 From: Sny Date: Wed, 9 Oct 2024 09:39:54 +0530 Subject: [PATCH] OpenConceptLab/ocl_issues#1621 | Concept Detail View | Locales with name/description type and preferred --- src/components/concepts/Locales.jsx | 47 ++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/src/components/concepts/Locales.jsx b/src/components/concepts/Locales.jsx index 07b42ea7..50096a04 100644 --- a/src/components/concepts/Locales.jsx +++ b/src/components/concepts/Locales.jsx @@ -5,16 +5,52 @@ import ListItem from '@mui/material/ListItem'; import ListItemText from '@mui/material/ListItemText'; import ListItemAvatar from '@mui/material/ListItemAvatar'; import Paper from '@mui/material/Paper'; +import Chip from '@mui/material/Chip'; import Typography from '@mui/material/Typography' import Divider from '@mui/material/Divider' import IconButton from '@mui/material/IconButton' import CopyIcon from '@mui/icons-material/ContentCopy'; +import PreferredIcon from '@mui/icons-material/FlagOutlined'; import { groupBy, forEach, has, compact, without, keys, orderBy, map } from 'lodash' import { toFullAPIURL, copyURL } from '../../common/utils'; import { OperationsContext } from '../app/LayoutContext'; const borderColor = 'rgba(0, 0, 0, 0.12)' +const LocalePrimary = ({ locale }) => { + const locale_type = locale.name_type || locale.description_type + return ( + + + {locale.name || locale.description} + + { + Boolean(locale_type) && + + } + { + locale.locale_preferred && + + } + + ) +} + const LocaleItem = ({ locale, url }) => { const { t } = useTranslation() const { setAlert } = React.useContext(OperationsContext); @@ -39,7 +75,16 @@ const LocaleItem = ({ locale, url }) => { } > - + } + secondary={externalID} + sx={{ + margin: '2px 0', + '.MuiListItemText-primary': { + display: 'flex' + } + }} + />