Untitled

 avatar
unknown
plain_text
12 days ago
710 B
4
Indexable
import { ReactNode } from 'react'

import { Button } from '../../index'
import { BasicButtonProps, ButtonSizes, ButtonVariants } from '../../models'
import { StartIconContainer, EndIconContainer } from './styled'

type ButtonProps = BasicButtonProps & {
  startIcon?: ReactNode
  endIcon?: ReactNode
  children: ReactNode
  onClick?: () => void
}

export const BasicButton = ({
  startIcon = null,
  endIcon = null,
  children,
  ...rest
}: ButtonProps) => {
  return (
    <Button {...rest}>
      {startIcon && <StartIconContainer>{startIcon}</StartIconContainer>}
      {children}
      {endIcon && <EndIconContainer>{endIcon}</EndIconContainer>}
    </Button>
  )
}

export { ButtonSizes, ButtonVariants }
Editor is loading...
Leave a Comment