Total Complexity | 1 |
Complexity/F | 0 |
Lines of Code | 49 |
Function Count | 0 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import { DEMO_COMMON_PROPS } from "app/constants/demo-props"; |
||
2 | |||
3 | import { BooleanProp, Demo, NumberProp } from "@cianciarusocataldo/demo-ui"; |
||
4 | |||
5 | import { List } from "modular-ui-preview"; |
||
6 | import { ComponentPage } from "app/components/ComponentPage"; |
||
7 | |||
8 | const ListPage = () => ( |
||
9 | <ComponentPage |
||
10 | name="List" |
||
11 | render={(t) => { |
||
12 | const elementsLabel = t("props", { context: "elements" }); |
||
13 | |||
14 | return ( |
||
15 | <Demo |
||
16 | label="List" |
||
17 | props={{ |
||
18 | ...DEMO_COMMON_PROPS, |
||
19 | shadow: BooleanProp(false), |
||
20 | [elementsLabel]: NumberProp(3), |
||
21 | }} |
||
22 | rows={[ |
||
23 | ["className", "hide", "dark", "unstyled", "shadow", elementsLabel], |
||
24 | ]} |
||
25 | > |
||
26 | {(props: any) => { |
||
27 | let elements: string[] = []; |
||
28 | for (let i = 0; i < (props[elementsLabel] as number); ++i) { |
||
29 | elements.push( |
||
30 | t("props", { context: "elements_single", index: i + 1 }) |
||
31 | ); |
||
32 | } |
||
33 | |||
34 | return ( |
||
35 | <div className="m-auto flex flex-col items-center text-xl"> |
||
36 | <List elements={elements} {...props} /> |
||
37 | </div> |
||
38 | ); |
||
39 | }} |
||
40 | </Demo> |
||
41 | ); |
||
42 | }} |
||
43 | > |
||
44 | {} |
||
45 | </ComponentPage> |
||
46 | ); |
||
47 | |||
48 | export default ListPage; |
||
49 |