summaryrefslogtreecommitdiff
path: root/src/components/Button.tsx
blob: 8f2398bb54fc3d6b7efe3cb1e54ad36474253efc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import React from 'react';

interface Props {
  variant?: 'contained' | 'outlined';
  size?: 'sm' | 'md' | 'lg';
  children: string;
}


const variants = {
  contained: 'bg-black text-white',
  outlined: 'border-2 border-black',
};

const sizes = {
  lg: 'p-5',
  md: 'p-4',
  sm: 'p-3',
};

const Button: React.FC<Props> = ({ variant = 'contained', size = 'md', children }) => {
  return (
    <button
      type="button"
      className={`m-3 font-bold tracking-wide hover:underline focus:outline-none ${variants[variant]} ${sizes[size]}`}
    >
      {children}
    </button>
  );
};

export default Button;