import { Link } from 'react-router-dom' import { ActionIcon, ActionIconProps } from './ActionIcon' import React from 'react' interface ActionButtonProps extends React.PropsWithChildren { icon?: ActionIconProps className?: string onClick?: () => void to?: string Element?: | 'button' | 'link' | React.ComponentType> } export const ActionButton = ({ icon, className, onClick, to = '/', Element = 'button', children, ...props }: ActionButtonProps) => { const classNames = `group mono text-base flex items-center gap-2 rounded-sm border border-chalkboard-40 dark:border-chalkboard-60 hover:border-liquid-40 dark:hover:bg-chalkboard-90 p-[3px] ${ icon ? 'pr-2' : 'px-2' } ${className}` if (Element === 'button') { return ( ) } else if (Element === 'link') { return ( {icon && } {children} ) } else { return ( {icon && } {children} ) } }