import styled from "styled-components"; import { defaultStyles } from "../defaults"; type ButtonProps = { $short?: boolean; }; const onKeyDown: React.KeyboardEventHandler = (event) => { if (!(event.target instanceof HTMLTextAreaElement)) event.preventDefault(); }; const Button = styled.button.attrs(({ as }) => ({ onKeyDown, type: !as || as === "button" ? "button" : undefined, }))` ${defaultStyles} background-color: transparent; font-family: inherit; max-width: ${({ $short }) => ($short ? "31px" : undefined)}; width: 100%; `; export default Button;