feat: show labels in widget selector

This commit is contained in:
SagarRajput-7 2025-05-14 06:32:49 +05:30
parent d6088f97e7
commit f9f463cce6
3 changed files with 8 additions and 1 deletions

View File

@ -65,6 +65,7 @@ const CustomMultiSelect: React.FC<CustomMultiSelectProps> = ({
maxTagTextLength,
onDropdownVisibleChange,
showIncompleteDataMessage = false,
showLabels = false,
...rest
}) => {
// ===== State & Refs =====
@ -1709,7 +1710,11 @@ const CustomMultiSelect: React.FC<CustomMultiSelectProps> = ({
// Custom Tag Render (needs significant updates)
const tagRender = useCallback(
(props: CustomTagProps): React.ReactElement => {
const { label, value, closable, onClose } = props;
const { label: labelProp, value, closable, onClose } = props;
const label = showLabels
? options.find((option) => option.value === value)?.label || labelProp
: labelProp;
// If the display value is the special ALL value, render the ALL tag
if (allOptionShown) {

View File

@ -60,4 +60,5 @@ export interface CustomMultiSelectProps
onRetry?: () => void;
maxTagTextLength?: number;
showIncompleteDataMessage?: boolean;
showLabels?: boolean;
}

View File

@ -23,6 +23,7 @@ export function WidgetSelector({
value={selectedWidgets}
labelInValue
onChange={(value): void => setSelectedWidgets(value as string[])}
showLabels
/>
);
}