Refactor SimplePropertyFilter to Move MissingPlaceholder Logic
- Moved the MissingPlaceholder component logic to a new position within the SimplePropertyFilter component for improved readability and structure. - Ensured that the component correctly displays a message when no options are found while maintaining the loading state functionality.
This commit is contained in:
parent
d180f2217a
commit
451787debd
@ -270,17 +270,6 @@ const SimplePropertyFilter = ({
|
|||||||
emitChange([...hiddenSelected, ...visibleCheckedKeys])
|
emitChange([...hiddenSelected, ...visibleCheckedKeys])
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!loading && options.length === 0) {
|
|
||||||
return (
|
|
||||||
<MissingPlaceholder
|
|
||||||
message='No options found.'
|
|
||||||
hasBackground={false}
|
|
||||||
hasBorder={false}
|
|
||||||
padding='0'
|
|
||||||
/>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isDateTimeProperty(property)) {
|
if (isDateTimeProperty(property)) {
|
||||||
return (
|
return (
|
||||||
<SimpleDateTimePropertyFilter
|
<SimpleDateTimePropertyFilter
|
||||||
@ -296,6 +285,17 @@ const SimplePropertyFilter = ({
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!loading && options.length === 0) {
|
||||||
|
return (
|
||||||
|
<MissingPlaceholder
|
||||||
|
message='No options found.'
|
||||||
|
hasBackground={false}
|
||||||
|
hasBorder={false}
|
||||||
|
padding='0'
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Spin spinning={loading} indicator={<LoadingOutlined spin />}>
|
<Spin spinning={loading} indicator={<LoadingOutlined spin />}>
|
||||||
<Checkbox.Group
|
<Checkbox.Group
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user