import { useTranslations } from 'next-intl'

export type Mode = 'single' | 'multiple' | 'range'

export const getMask = (mode: Mode) => {
	switch (mode) {
		case 'single':
			return '__/__/____'
		case 'multiple':
			return '__/__/____ — __/__/____'
		case 'range':
			return '__/__/____ — __/__/____'
	}
}

export const getPlaceholder = (mode: Mode) => {
	const t = useTranslations('calendar.placeholder')

	switch (mode) {
		case 'single':
			return t('single')
		case 'multiple':
			return t('multiple')
		case 'range':
			return t('range')
	}
}

export const getSideOffset = (size: 'sm' | 'md' | 'lg') => {
	switch (size) {
		case 'sm':
			return 9
		case 'md':
			return 13
		case 'lg':
			return 18
	}
}

export const getAlignOffset = (size: 'sm' | 'md' | 'lg') => {
	switch (size) {
		case 'sm':
			return -12
		case 'md':
			return -14
		case 'lg':
			return -16
	}
}
