import React, { ReactNode, useState } from 'react' interface ButtonProps { children?: ReactNode className?: string icon?: ReactNode primary?: boolean disabled?: boolean onKeyDown?: () => void onClick?: () => void onDown?: (ev: PointerEvent) => void onUp?: (ev: PointerEvent) => void } export default function Button(props: ButtonProps) { const { children, className, disabled, icon, primary, onKeyDown, onClick, onDown, onUp, } = props const [active, setActive] = useState(false) let background = '' if (primary && !disabled) { background = 'bg-primary hover:bg-black hover:text-white' } if (active) { background = 'bg-black text-white' } if (!primary && !active) { background = 'hover:bg-primary' } return (