1
0
mirror of https://github.com/vercel/commerce.git synced 2025-03-16 23:42:32 +00:00
Luis Alvarez D 0e7e7b7d5f
Add Next.js ESLint ()
* Added Next.js eslint

* added eslint to lint-staged

* Added eslint config for prettier

* Fixed eslint issues in multiple files

* Fixed error in linter
2021-08-02 21:54:58 -05:00

26 lines
561 B
TypeScript

import { FC, memo } from 'react'
import rangeMap from '@lib/range-map'
import { Star } from '@components/icons'
import cn from 'classnames'
export interface RatingProps {
value: number
}
const Quantity: FC<RatingProps> = ({ value = 5 }) => (
<div className="flex flex-row py-6 text-accent-9">
{rangeMap(5, (i) => (
<span
key={`star_${i}`}
className={cn('inline-block ml-1 ', {
'text-accent-5': i >= Math.floor(value),
})}
>
<Star />
</span>
))}
</div>
)
export default memo(Quantity)