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:
Tom Butcher 2026-09-01 19:55:23 +01:00
parent d180f2217a
commit 451787debd

View File

@ -270,17 +270,6 @@ const SimplePropertyFilter = ({
emitChange([...hiddenSelected, ...visibleCheckedKeys])
}
if (!loading && options.length === 0) {
return (
<MissingPlaceholder
message='No options found.'
hasBackground={false}
hasBorder={false}
padding='0'
/>
)
}
if (isDateTimeProperty(property)) {
return (
<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 (
<Spin spinning={loading} indicator={<LoadingOutlined spin />}>
<Checkbox.Group