You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

IconCard.tsx 972B

12345678910111213141516171819202122232425262728293031
  1. import React, { useCallback } from 'react'
  2. import { Typography } from 'antd';
  3. import { BankFilled, WalletFilled } from '@ant-design/icons';
  4. const { Text, Title } = Typography
  5. const IconCard = ({ active, iconName, text, handleClick }) => {
  6. const renderIcon = useCallback((nameId: string) => {
  7. if (nameId === "card") return <WalletFilled className='!text-white !text-xl' />
  8. else if (nameId === "bank") return <BankFilled className='!text-white !text-xl' />
  9. else return <></>
  10. }, [])
  11. return (
  12. <div
  13. onClick={handleClick}
  14. className={`
  15. ${active ? 'bg-blue-950' : 'bg-gray-400'}
  16. hover:bg-blue-950 transition-all ease-in-out
  17. rounded-lg p-4 max-w-[160px] cursor-pointer
  18. `}
  19. >
  20. {renderIcon(iconName)}
  21. <Text className='!text-xs !text-white !block'>{text}</Text>
  22. </div>
  23. )
  24. }
  25. export default IconCard