import { PageSize } from './page' import { NormalSizes } from '../utils/prop-types' import { HuiThemesLayout } from '../themes' export const getPageSize = (size: PageSize, layout: HuiThemesLayout): string => { const presets: { [key in NormalSizes]: string } = { medium: layout.pageWidth, small: `calc(${layout.pageWidth} - 100px)`, mini: `calc(${layout.pageWidth} - 180px)`, large: `calc(${layout.pageWidth} + 100px)` } const presetValue = presets[size as NormalSizes] if (!presetValue) return size as string return presetValue }