mirror of
https://github.com/vercel/commerce.git
synced 2025-07-05 12:41:21 +00:00
22 lines
403 B
TypeScript
22 lines
403 B
TypeScript
import React from 'react'
|
|
|
|
interface Props {
|
|
index: number
|
|
dotActive:number
|
|
onClick: (index: number) => void
|
|
}
|
|
|
|
const CustomDot = ({ index, onClick, dotActive }: Props) => {
|
|
const handleOnClick = () => {
|
|
onClick && onClick(index)
|
|
}
|
|
return (
|
|
<button
|
|
onClick={handleOnClick}
|
|
className={'dot' + (dotActive === index ? ' active' : '')}
|
|
/>
|
|
)
|
|
}
|
|
|
|
export default CustomDot
|