Add MissingPlaceholder to SimplePropertyFilter for No Options State
- Implemented a MissingPlaceholder component in SimplePropertyFilter to display a message when no options are available, enhancing user feedback during data retrieval. - Improved loading and visibility handling to optimize the user experience in scenarios with empty option lists.
This commit is contained in:
parent
50a9ad0f4a
commit
4f36e16c43
@ -10,6 +10,7 @@ import {
|
|||||||
import ObjectProperty from './ObjectProperty'
|
import ObjectProperty from './ObjectProperty'
|
||||||
import SimpleDateTimePropertyFilter from './SimpleDateTimePropertyFilter'
|
import SimpleDateTimePropertyFilter from './SimpleDateTimePropertyFilter'
|
||||||
import { LoadingOutlined } from '@ant-design/icons'
|
import { LoadingOutlined } from '@ant-design/icons'
|
||||||
|
import MissingPlaceholder from './MissingPlaceholder'
|
||||||
const { Text } = Typography
|
const { Text } = Typography
|
||||||
|
|
||||||
const isDateTimeProperty = (property) =>
|
const isDateTimeProperty = (property) =>
|
||||||
@ -255,6 +256,17 @@ 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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user