blob: 60f42c72f453bd5c1f57dacd5d3ccbd5d6abd342 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
import type { ComponentChildren } from 'preact';
import './Button.css';
export interface ButtonProps {
children: ComponentChildren;
kind?: 'primary' | 'outline' | 'ghost';
props: Record<string, any>;
}
const Button = ({ children, kind = 'primary', ...props }: ButtonProps) => {
const Elem = props.href ? 'a' : 'button';
return (
<Elem {...props} class={(props.class || '') + ' __Button ' + kind}>
{children}
</Elem>
);
};
export default Button;
|