summaryrefslogtreecommitdiff
path: root/src/lib/brand/components/BrandCard.jsx
blob: 1bcdb5ab0abf30c3e4efcf131b4dd5e758506c0b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import Image from '@/core/components/elements/Image/Image'
import Link from '@/core/components/elements/Link/Link'
import { createSlug } from '@/core/utils/slug'

const BrandCard = ({ brand }) => {
  return (
    <Link
      href={createSlug('/shop/brands/', brand.name, brand.id)}
      className='py-1 px-2 rounded border border-gray_r-6 h-12 flex justify-center items-center'
    >
      {brand.logo && (
        <Image
          src={brand.logo}
          alt={brand.name}
          className='h-full object-contain object-center'
        />
      )}
      {!brand.logo && (
        <span
          className='text-center'
          style={{ fontSize: `${14 - brand.name.length * 0.5}px` }}
        >
          {brand.name}
        </span>
      )}
    </Link>
  )
}

export default BrandCard