import React from "react"; import styled, { DefaultTheme } from "styled-components"; enum ButtonType { DEFAULT = "BLURPLE", DANGER = "DANGER", SUCCESS = "SEAGREEN", WARNING = "ORANGE", } export interface ButtonProps extends React.ButtonHTMLAttributes { status?: keyof typeof ButtonType; } function getButtonStatus(status: keyof typeof ButtonType, theme: DefaultTheme) { return theme[ButtonType[status]]; } const StyledButton = styled.button<{ status: keyof typeof ButtonType }>` background: ${({ status, theme }) => getButtonStatus(status, theme)}; color: ${({ theme }) => theme.FULL_WHITE}; cursor: pointer; `; const StyledButtonContent = styled.div``; const Button: React.FC = ({ children, status, ...props }) => { return ( {children} ); }; export default Button;