Title.tsx30 lines · main
| 1 | import React from 'react' |
| 2 | |
| 3 | // @ts-ignore |
| 4 | // import TitleStyles from './Title.module.css' |
| 5 | |
| 6 | interface Props { |
| 7 | className?: string |
| 8 | level?: 1 | 2 | 3 | 4 | 5 |
| 9 | children: any |
| 10 | style?: React.CSSProperties |
| 11 | } |
| 12 | |
| 13 | function Title({ level = 1, children, style }: Props) { |
| 14 | // let classes = [TitleStyles['sbui-typography-title']] |
| 15 | // if (className) { |
| 16 | // classes.push(className) |
| 17 | // } |
| 18 | const CustomTag: any = `h${level}` |
| 19 | |
| 20 | return ( |
| 21 | <CustomTag |
| 22 | style={style} |
| 23 | // className={classes.join(' ')} |
| 24 | > |
| 25 | {children} |
| 26 | </CustomTag> |
| 27 | ) |
| 28 | } |
| 29 | |
| 30 | export default Title |