11import { FC , ReactNode } from 'react'
2- import Box from '@mui/material/Box'
3- import Typography from '@mui/material/Typography'
4- import { styled } from '@mui/material/styles'
52import lightBackgroundEmptyState from './images/background-empty-state.svg'
63import darkBackgroundEmptyState from './images/background-empty-state-dark.svg'
74import CancelIcon from '@mui/icons-material/Cancel'
8- import { COLORS } from '../../../styles/theme/colors'
9-
10- const StyledBox = styled ( Box ) ( ( { theme } ) => ( {
11- display : 'flex' ,
12- alignItems : 'center' ,
13- justifyContent : 'center' ,
14- flexDirection : 'column' ,
15- color : theme . palette . layout . main ,
16- backgroundImage : `url("${ darkBackgroundEmptyState } ")` ,
17- backgroundPosition : 'center' ,
18- backgroundRepeat : 'no-repeat' ,
19- backgroundSize : 'cover' ,
20- borderRadius : 6 ,
21- } ) )
22-
23- const StyledBoxLight = styled ( Box ) ( ( ) => ( {
24- display : 'flex' ,
25- alignItems : 'center' ,
26- justifyContent : 'center' ,
27- flexDirection : 'column' ,
28- backgroundImage : `url("${ lightBackgroundEmptyState } ")` ,
29- color : COLORS . brandExtraDark ,
30- backgroundPosition : 'center' ,
31- backgroundRepeat : 'no-repeat' ,
32- backgroundSize : 'cover' ,
33- height : '100%' ,
34- } ) )
5+ import { cn } from '@oasisprotocol/ui-library/src/lib/utils'
356
367type EmptyStateProps = {
378 description : ReactNode
@@ -42,21 +13,25 @@ type EmptyStateProps = {
4213
4314export const EmptyState : FC < EmptyStateProps > = ( { description, title, light, minHeight = '360px' } ) => {
4415 const content = (
45- < Box sx = { { color : light ? 'inherit' : COLORS . white , textAlign : 'center' } } >
46- < Typography component = "span" sx = { { fontSize : '30px' , fontWeight : 500 , display : 'block' } } >
47- { title }
48- </ Typography >
49- < Typography component = "span" sx = { { fontSize : '16px' } } >
50- { description }
51- </ Typography >
52- </ Box >
16+ < div className = { cn ( 'text-center' , light ? 'text-inherit' : 'text-white' ) } >
17+ < span className = "block text-2xl font-medium" > { title } </ span >
18+ < span className = "text-sm" > { description } </ span >
19+ </ div >
5320 )
5421 return light ? (
55- < StyledBoxLight sx = { { minHeight } } >
22+ < div
23+ className = "flex flex-col items-center justify-center bg-no-repeat bg-cover bg-center h-full"
24+ style = { { backgroundImage : `url(${ lightBackgroundEmptyState } )` , minHeight } }
25+ >
5626 < CancelIcon color = "error" fontSize = "large" />
5727 { content }
58- </ StyledBoxLight >
28+ </ div >
5929 ) : (
60- < StyledBox sx = { { minHeight } } > { content } </ StyledBox >
30+ < div
31+ className = "flex flex-col items-center justify-center bg-no-repeat bg-cover bg-center rounded-md text-white"
32+ style = { { backgroundImage : `url(${ darkBackgroundEmptyState } )` , minHeight } }
33+ >
34+ { content }
35+ </ div >
6136 )
6237}
0 commit comments