New loading placeholder and transparent placeholders.

This commit is contained in:
Tom Butcher 2025-09-07 19:45:30 +01:00
parent 8310e7d12b
commit 69c8ecd23a
2 changed files with 51 additions and 4 deletions

View File

@ -0,0 +1,38 @@
import { Card, Flex, Typography } from 'antd'
import { LoadingOutlined } from '@ant-design/icons'
import PropTypes from 'prop-types'
const { Text } = Typography
const LoadingPlaceholder = ({ message, hasBackground = true }) => {
return (
<Card
size='small'
style={{
background: hasBackground == false ? 'transparent' : undefined,
border: hasBackground == false ? '1px solid rgb(0 0 0 / 7%)' : undefined
}}
>
<Flex
justify='center'
gap={'small'}
style={{
height: '100%'
}}
align='center'
>
<Text type='secondary'>
<LoadingOutlined />
</Text>
<Text type='secondary'>{message}</Text>
</Flex>
</Card>
)
}
LoadingPlaceholder.propTypes = {
message: PropTypes.string.isRequired,
hasBackground: PropTypes.bool
}
export default LoadingPlaceholder

View File

@ -4,13 +4,21 @@ import PropTypes from 'prop-types'
const { Text } = Typography
const MissingPlaceholder = ({ message }) => {
const MissingPlaceholder = ({ message, hasBackground = true }) => {
return (
<Card size='small'>
<Card
size='small'
style={{
background: hasBackground == false ? 'transparent' : undefined,
border: hasBackground == false ? '1px solid rgb(0 0 0 / 7%)' : undefined
}}
>
<Flex
justify='center'
gap={'small'}
style={{ height: '100%' }}
style={{
height: '100%'
}}
align='center'
>
<Text type='secondary'>
@ -23,7 +31,8 @@ const MissingPlaceholder = ({ message }) => {
}
MissingPlaceholder.propTypes = {
message: PropTypes.string.isRequired
message: PropTypes.string.isRequired,
hasBackground: PropTypes.bool
}
export default MissingPlaceholder