|
| 1 | +--- |
| 2 | +import ComponentWrapper from '@static/ComponentWrapper.astro' |
| 3 | +import Layout from '@static/Layout.astro' |
| 4 | +
|
| 5 | +import AstroEmpty from '@blocks/Empty/Empty.astro' |
| 6 | +import SvelteEmpty from '@blocks/Empty/Empty.svelte' |
| 7 | +import ReactEmpty from '@blocks/Empty/Empty.tsx' |
| 8 | +
|
| 9 | +import { getSections } from '@helpers' |
| 10 | +import { emptyProps } from '@data' |
| 11 | +
|
| 12 | +const sections = getSections({ |
| 13 | + title: 'empty', |
| 14 | + components: [AstroEmpty, SvelteEmpty, ReactEmpty] |
| 15 | +}) |
| 16 | +--- |
| 17 | + |
| 18 | +<Layout> |
| 19 | + <h1>Empty</h1> |
| 20 | + <h2> |
| 21 | + <a href="/blocks"> |
| 22 | + {'<-'} Back to all blocks |
| 23 | + </a> |
| 24 | + </h2> |
| 25 | + |
| 26 | + <div class="grid md-2 lg-3"> |
| 27 | + <ComponentWrapper type="Astro"> |
| 28 | + <AstroEmpty {...emptyProps} /> |
| 29 | + </ComponentWrapper> |
| 30 | + |
| 31 | + <ComponentWrapper type="Svelte"> |
| 32 | + <SvelteEmpty {...emptyProps} /> |
| 33 | + </ComponentWrapper> |
| 34 | + |
| 35 | + <ComponentWrapper type="React"> |
| 36 | + <ReactEmpty {...emptyProps} /> |
| 37 | + </ComponentWrapper> |
| 38 | + </div> |
| 39 | + |
| 40 | + {sections.map(section => ( |
| 41 | + <h1>{section.title}</h1> |
| 42 | + <Fragment> |
| 43 | + {section.subTitle && <h2 set:html={section.subTitle} />} |
| 44 | + </Fragment> |
| 45 | + <div class="grid md-2 lg-3"> |
| 46 | + <ComponentWrapper title="Required props only"> |
| 47 | + <section.component |
| 48 | + title={emptyProps.title} |
| 49 | + text={emptyProps.text} |
| 50 | + /> |
| 51 | + </ComponentWrapper> |
| 52 | + |
| 53 | + <ComponentWrapper title="With icon"> |
| 54 | + <section.component |
| 55 | + icon={emptyProps.icon} |
| 56 | + title={emptyProps.title} |
| 57 | + text={emptyProps.text} |
| 58 | + /> |
| 59 | + </ComponentWrapper> |
| 60 | + |
| 61 | + <ComponentWrapper title="Icon with background"> |
| 62 | + <section.component |
| 63 | + icon={emptyProps.icon} |
| 64 | + iconWithBackground={true} |
| 65 | + title={emptyProps.title} |
| 66 | + text={emptyProps.text} |
| 67 | + /> |
| 68 | + </ComponentWrapper> |
| 69 | + </div> |
| 70 | + ))} |
| 71 | +</Layout> |
0 commit comments