File tree Expand file tree Collapse file tree 2 files changed +41
-1
lines changed
redisinsight/ui/src/components/base/layout Expand file tree Collapse file tree 2 files changed +41
-1
lines changed Original file line number Diff line number Diff line change 1+ import React , { HTMLAttributes } from 'react'
2+ import styled from 'styled-components'
3+
4+ interface RiEmptyPromptProps extends Omit < HTMLAttributes < HTMLDivElement > , 'title' > {
5+ body ?: React . ReactNode
6+ title ?: React . ReactNode
7+ icon ?: React . ReactNode
8+ }
9+
10+ const StyledEmptyPrompt = styled . div `
11+ max-width: 36em;
12+ text-align: center;
13+ padding: 24px;
14+ margin: auto;
15+ `
16+
17+ const Spacer = styled . div `
18+ height: ${ ( { theme } ) => theme . core . space . space100 } ;
19+ `
20+
21+ const RiEmptyPrompt = ( { body, title, icon } : RiEmptyPromptProps ) => (
22+ < StyledEmptyPrompt >
23+ { icon }
24+ { title && (
25+ < >
26+ < Spacer />
27+ { title }
28+ </ >
29+ ) }
30+ { body && (
31+ < >
32+ < Spacer />
33+ { body }
34+ </ >
35+ ) }
36+ </ StyledEmptyPrompt >
37+ )
38+
39+ export default RiEmptyPrompt
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import LoadingContent from './loading-content/LoadingContent'
33import ResizableContainer from './resize/container/ResizableContainer'
44import ResizablePanel from './resize/panel/ResizablePanel'
55import ResizablePanelHandle from './resize/handle/ResizablePanelHandle'
6-
6+ import RiEmptyPrompt from './empty-prompt/RiEmptyPrompt'
77
88export * from './card'
99export * from './horizontal-spacer'
@@ -14,4 +14,5 @@ export {
1414 ResizablePanel ,
1515 ResizableContainer ,
1616 ResizablePanelHandle ,
17+ RiEmptyPrompt ,
1718}
You can’t perform that action at this time.
0 commit comments