Total Complexity | 1 |
Complexity/F | 1 |
Lines of Code | 22 |
Function Count | 1 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | |||
2 | import React from "react" |
||
3 | import { classNaming } from "../src" |
||
4 | import type { ClassNamesProperty, ClassHash } from "../src" |
||
5 | |||
6 | type MyComponentProps = ClassNamesProperty<{ |
||
7 | btn: ClassHash |
||
8 | icon: ClassHash |
||
9 | btn__icon: ClassHash |
||
10 | }> |
||
11 | export default function MyComponent({classnames}: MyComponentProps) { |
||
12 | const cssClasses = classNaming({classnames}) |
||
13 | |||
14 | return <> |
||
15 | { "/// MyComponent.tsx" } |
||
16 | {/* className="btn" */} |
||
17 | <button {...cssClasses({btn: true})}> |
||
18 | {/* className="btn__icon icon" */} |
||
19 | <i {...cssClasses({btn__icon: true, icon: true})}/> |
||
20 | </button> |
||
21 | </> |
||
22 | } |
||
23 |