import { RtPopoverProps } from '../rt-popover.types'; const mapAligmentLabels: Record< NonNullable, 'left' | 'middle' | 'right' > = { start: 'left', middle: 'middle', end: 'right', }; export const getLabelsAlign = ( position: 'bottom' | 'top' | 'left' | 'right', aligment: RtPopoverProps['alignment'] = 'middle', isRtl: boolean ): 'left' | 'middle' | 'right' => { if (isRtl && (position === 'left' || position === 'right')) { return position; } if (position === 'left') { return 'right'; } if (position === 'right') { return 'left'; } return mapAligmentLabels[aligment]; };