1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 | import React from 'react';
|
7 | import { classes } from '../utils';
|
8 |
|
9 |
|
10 |
|
11 |
|
12 | export interface IButtonProps
|
13 | extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
14 | |
15 |
|
16 |
|
17 | minimal?: boolean;
|
18 | |
19 |
|
20 |
|
21 | small?: boolean;
|
22 | }
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 | export function Button(props: IButtonProps): JSX.Element {
|
31 | const { minimal, small, children, ...others } = props;
|
32 | return (
|
33 | <button
|
34 | {...others}
|
35 | className={classes(
|
36 | props.className,
|
37 | minimal ? 'jp-mod-minimal' : '',
|
38 | small ? 'jp-mod-small' : '',
|
39 | 'jp-Button'
|
40 | )}
|
41 | >
|
42 | {children}
|
43 | </button>
|
44 | );
|
45 | }
|