add-button.tsx 640 B

123456789101112131415161718192021222324252627282930
  1. 'use client'
  2. import type { FC } from 'react'
  3. import React from 'react'
  4. import cn from 'classnames'
  5. import {
  6. RiAddLine,
  7. } from '@remixicon/react'
  8. type Props = {
  9. className?: string
  10. text: string
  11. onClick: () => void
  12. }
  13. const AddButton: FC<Props> = ({
  14. className,
  15. text,
  16. onClick,
  17. }) => {
  18. return (
  19. <div
  20. className={cn(className, 'flex items-center h-7 justify-center bg-gray-100 hover:bg-gray-200 rounded-lg cursor-pointer text-xs font-medium text-gray-700 space-x-1')}
  21. onClick={onClick}
  22. >
  23. <RiAddLine className='w-3.5 h-3.5' />
  24. <div>{text}</div>
  25. </div>
  26. )
  27. }
  28. export default React.memo(AddButton)