homeman-deno/components/Button.tsx

15 lines
375 B
TypeScript
Raw Normal View History

2024-01-05 13:22:56 -06:00
import { JSX } from 'preact'
import { IS_BROWSER } from '$fresh/runtime.ts'
2024-01-07 10:55:18 -06:00
export function Button(
{ disabled, className, ...props }: JSX.HTMLAttributes<HTMLButtonElement>,
) {
2024-01-05 13:22:56 -06:00
return (
<button
{...props}
2024-01-07 10:55:18 -06:00
disabled={!IS_BROWSER || disabled}
class={`px-2 py-1 bg-gray-500/20 rounded hover:bg-gray-500/25 cursor-pointer transition-colors ${className}`}
2024-01-05 13:22:56 -06:00
/>
)
}