import type { FC, MouseEventHandler } from 'react'; import type { MessageDescriptor } from 'react-intl'; import { useIntl } from 'react-intl'; import ChevronLeftIcon from '@/material-icons/400-24px/chevron_left.svg?react'; import ChevronRightIcon from '@/material-icons/400-24px/chevron_right.svg?react'; import { IconButton } from '../icon_button'; import type { MessageKeys } from './index'; export interface CarouselPaginationProps { onNext: MouseEventHandler; onPrev: MouseEventHandler; current: number; max: number; className?: string; messages: Record; } export const CarouselPagination: FC = ({ onNext, onPrev, current, max, className = '', messages, }) => { const intl = useIntl(); return (
{intl.formatMessage(messages.current, { current: current + 1, max, sr: (chunk) => {chunk}, })}
); };