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}
|
2024-01-17 21:30:41 -06:00
|
|
|
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}`}
|
2024-01-05 13:22:56 -06:00
|
|
|
/>
|
|
|
|
)
|
|
|
|
}
|