aboutsummaryrefslogtreecommitdiff
path: root/components/button.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'components/button.tsx')
-rw-r--r--components/button.tsx9
1 files changed, 9 insertions, 0 deletions
diff --git a/components/button.tsx b/components/button.tsx
new file mode 100644
index 0000000..452d85f
--- /dev/null
+++ b/components/button.tsx
@@ -0,0 +1,9 @@
+export default function Button(props: {
+ text: string;
+ href?: string;
+ onclick?: () => void;
+}) {
+ return props.href ?
+ <a href={props.href} className="button">{props.text}</a> :
+ <button onClick={props.onclick} className="button">{props.text}</button>
+}