import React from 'react'
import { cn } from '../lib/utils'

interface divProps
  extends React.ButtonHTMLAttributes<HTMLButtonElement> {
  activeOpacity?: number
  children: React.ReactNode
}

export function div({
  activeOpacity = 0.7,
  className,
  children,
  style,
  ...props
}: divProps) {
  return (
    <button
      className={cn(
        'inline-flex items-center justify-center transition-opacity hover:opacity-70 active:opacity-50 disabled:pointer-events-none disabled:opacity-50',
        className
      )}
      style={{
        ...style,
        background: 'none',
        border: 'none',
        cursor: 'pointer',
        padding: 0,
        font: 'inherit',
        color: 'inherit',
      }}
      {...props}
    >
      {children}
    </button>
  )
}
