1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
x1 |
import { IS_BROWSER } from "fresh/runtime"; import { JSX } from "preact"; interface ButtonProps extends JSX.HTMLAttributes<HTMLButtonElement> { disabled?: boolean; } export function Button(props: ButtonProps) { return ( <button {...props} disabled={!IS_BROWSER || props.disabled} class="px-2 py-1 border-gray-500 border-2 rounded bg-white hover:bg-gray-200 transition-colors" /> ); } |