import { RtPopoverPlacement, RtPopoverProps } from '../rt-popover.types'; import { mapAlignment, mapPositionRTL, mapPositionLTR } from './map-position'; type TRelativePlacement = 'bottom' | 'top' | 'left' | 'right'; export const mapPlacementProps = ( position: TRelativePlacement, alignment: NonNullable ): RtPopoverPlacement => { return `${position}${mapAlignment[alignment]}`; }; export const getRelativePlacement = ( position: NonNullable, rtl: boolean ): TRelativePlacement => { return (rtl ? mapPositionRTL : mapPositionLTR)[position]; };