mirror of
https://github.com/vercel/commerce.git
synced 2025-03-14 22:42:33 +00:00
* Added Next.js eslint * added eslint to lint-staged * Added eslint config for prettier * Fixed eslint issues in multiple files * Fixed error in linter
31 lines
788 B
TypeScript
31 lines
788 B
TypeScript
import { FC, MouseEventHandler, memo } from 'react'
|
|
import cn from 'classnames'
|
|
import s from './ProductSliderControl.module.css'
|
|
import { ArrowLeft, ArrowRight } from '@components/icons'
|
|
|
|
interface ProductSliderControl {
|
|
onPrev: MouseEventHandler<HTMLButtonElement>
|
|
onNext: MouseEventHandler<HTMLButtonElement>
|
|
}
|
|
|
|
const ProductSliderControl: FC<ProductSliderControl> = ({ onPrev, onNext }) => (
|
|
<div className={s.control}>
|
|
<button
|
|
className={cn(s.leftControl)}
|
|
onClick={onPrev}
|
|
aria-label="Previous Product Image"
|
|
>
|
|
<ArrowLeft />
|
|
</button>
|
|
<button
|
|
className={cn(s.rightControl)}
|
|
onClick={onNext}
|
|
aria-label="Next Product Image"
|
|
>
|
|
<ArrowRight />
|
|
</button>
|
|
</div>
|
|
)
|
|
|
|
export default memo(ProductSliderControl)
|