| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- import React from "react";
- import styled from "styled-components";
- interface Props {
- disabled?: boolean;
- children: React.ReactNode;
- onClick: () => void;
- className?: string;
- }
- const Button: React.FC<Props> = ({
- children,
- disabled,
- onClick,
- className,
- }) => {
- return (
- <ButtonWrapper className={className} disabled={disabled} onClick={onClick}>
- {children}
- </ButtonWrapper>
- );
- };
- export default Button;
- const ButtonWrapper = styled.div`
- display: flex;
- flex-direction: row;
- align-items: center;
- justify-content: space-between;
- font-size: 13px;
- cursor: pointer;
- font-family: "Work Sans", sans-serif;
- color: white;
- font-weight: 500;
- padding: 10px;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- cursor: ${(props: { disabled?: boolean }) =>
- props.disabled ? "not-allowed" : "pointer"};
- background: ${(props: { disabled?: boolean }) =>
- props.disabled ? "#aaaabbee" : "#616FEEcc"};
- :hover {
- background: ${(props: { disabled?: boolean }) =>
- props.disabled ? "" : "#505edddd"};
- }
- > i {
- color: white;
- width: 18px;
- height: 18px;
- font-weight: 600;
- font-size: 12px;
- border-radius: 20px;
- display: flex;
- align-items: center;
- margin-right: 5px;
- justify-content: center;
- }
- `;
|