|
1
|
export const defaultTemplate = ( |
|
2
|
{ jsx, componentName }: { jsx: any; componentName: string }, |
|
3
|
{ tpl }: { tpl: any } |
|
4
|
) => { |
|
5
|
return tpl` |
|
6
|
import * as React from "react" |
|
7
|
|
|
8
|
import type { IconProps } from "../types" |
|
9
|
|
|
10
|
const ${componentName} = React.forwardRef<SVGSVGElement, IconProps>(({ color = "currentColor", ...props }, ref) => { |
|
11
|
return ( |
|
12
|
${jsx} |
|
13
|
) |
|
14
|
}) |
|
15
|
${componentName}.displayName = "${componentName}" |
|
16
|
|
|
17
|
export default ${componentName} |
|
18
|
` |
|
19
|
} |
|
20
|
|
|
21
|
export const fixedTemplate = ( |
|
22
|
{ jsx, componentName }: { jsx: any; componentName: string }, |
|
23
|
{ tpl }: { tpl: any } |
|
24
|
) => { |
|
25
|
return tpl` |
|
26
|
import * as React from "react" |
|
27
|
|
|
28
|
import type { IconProps } from "../types" |
|
29
|
|
|
30
|
const ${componentName} = React.forwardRef<SVGSVGElement, Omit<IconProps, "color">>((props, ref) => { |
|
31
|
return ( |
|
32
|
${jsx} |
|
33
|
) |
|
34
|
}) |
|
35
|
${componentName}.displayName = "${componentName}" |
|
36
|
|
|
37
|
export default ${componentName} |
|
38
|
` |
|
39
|
} |