import React, { FC, MouseEvent } from 'react' import { Colors, flexFlow, FontSizes, getColor, typographyFont, zIndex, ZIndexNodeName, } from '@monorail/helpers/exports' import styled, { css } from '@monorail/helpers/styled-components' import { isUndefined } from '@monorail/sharedHelpers/typeGuards' import { CommonComponentType, CssOverridesType } from '@monorail/types' import { ButtonDisplay, ButtonSize, } from '@monorail/visualComponents/buttons/buttonTypes' import { IconButton } from '@monorail/visualComponents/buttons/IconButton' /* * Styles */ // TODO: remove this container and position on the arrow buttons themselves const ArrowButtonsContainer = styled.div` ${flexFlow('row')}; ${zIndex(ZIndexNodeName.ArrowButtons)}; height: 100%; pointer-events: none; ` const RatioContainer = styled.p` ${typographyFont(400, FontSizes.Title5)}; color: ${getColor(Colors.Black62a)}; margin: auto 4px; ` /* * Types */ export type ArrowButtonsProps = CommonComponentType & { current: number next?: (event: MouseEvent) => void previous?: (event: MouseEvent) => void total: number slideIndicatorType?: string size?: ButtonSize arrowColor?: Colors loop?: boolean cssArrowOverrides?: CssOverridesType } /* * Components */ export const ArrowButtons: FC = props => { const { current, next, previous, total, slideIndicatorType, cssArrowOverrides, arrowColor = Colors.Black, size, loop = false, ...otherProps } = props return ( {slideIndicatorType !== 'dot' && ( {`${current + 1} / ${total + 1}`} )} ) }