mirror of
https://github.com/nocobase/nocobase.git
synced 2026-09-24 16:02:20 +08:00
refactor(client): support read-pretty select to use string icon (#7420)
This commit is contained in:
@@ -16,6 +16,7 @@ import { useCollectionField } from '../../../data-source/collection-field/Collec
|
||||
import { EllipsisWithTooltip } from '../input/EllipsisWithTooltip';
|
||||
import { FieldNames, defaultFieldNames, getCurrentOptions } from './utils';
|
||||
import { withPopupWrapper } from '../../common/withPopupWrapper';
|
||||
import { Icon } from '../../../icon';
|
||||
|
||||
export interface SelectReadPrettyProps {
|
||||
value: any;
|
||||
@@ -54,7 +55,11 @@ const ReadPrettyInternal = observer(
|
||||
const content =
|
||||
field.value !== null &&
|
||||
currentOptions.map((option, index) => (
|
||||
<Tag key={index} color={option[fieldNames.color]} icon={option.icon}>
|
||||
<Tag
|
||||
key={index}
|
||||
color={option[fieldNames.color]}
|
||||
icon={typeof option.icon === 'string' ? <Icon type={option.icon} /> : option.icon}
|
||||
>
|
||||
{option[fieldNames.label]}
|
||||
</Tag>
|
||||
));
|
||||
|
||||
Reference in New Issue
Block a user