25 lines
628 B
TypeScript
25 lines
628 B
TypeScript
import { CarouselNextIcon } from '~/components/icons/carousel-next'
|
|
import { CarouselPreviousIcon } from '~/components/icons/carousel-previous'
|
|
|
|
type TCarouselButton = {
|
|
direction: 'prev' | 'next'
|
|
isEnabled: boolean
|
|
onClick: () => void
|
|
}
|
|
export const CarouselButton = ({
|
|
direction,
|
|
isEnabled,
|
|
onClick,
|
|
}: TCarouselButton) => {
|
|
const Icon = direction === 'prev' ? CarouselPreviousIcon : CarouselNextIcon
|
|
return (
|
|
<Icon
|
|
color={isEnabled ? '#2E2F7C' : '#DCDCDC'}
|
|
className={isEnabled ? 'cursor-pointer' : 'cursor-not-allowed'}
|
|
width={45}
|
|
height={45}
|
|
onClick={onClick}
|
|
/>
|
|
)
|
|
}
|