| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- import React from "react";
- import styled from "styled-components";
- type 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;
- 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;
- }
- `;
|