summaryrefslogtreecommitdiff
path: root/src/components/Button.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/Button.tsx')
-rw-r--r--src/components/Button.tsx19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/components/Button.tsx b/src/components/Button.tsx
new file mode 100644
index 0000000..60f42c7
--- /dev/null
+++ b/src/components/Button.tsx
@@ -0,0 +1,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; \ No newline at end of file