homeman-deno/components/Button.tsx
2024-01-17 21:30:41 -06:00

15 lines
414 B
TypeScript

import { JSX } from 'preact'
import { IS_BROWSER } from '$fresh/runtime.ts'
export function Button(
{ disabled, className, ...props }: JSX.HTMLAttributes<HTMLButtonElement>,
) {
return (
<button
{...props}
disabled={!IS_BROWSER || disabled}
class={`flex items-center justify-center gap-1 px-2 py-1 bg-gray-500/20 rounded hover:bg-gray-500/25 cursor-pointer transition-colors ${className}`}
/>
)
}