import { VerticalThreeLine } from 'components/Icons' interface Props { value: number marginThreshold?: number max: number } const THUMB_WIDTH = 33 function InputOverlay({ max, value, marginThreshold }: Props) { const thumbPosPercent = max === 0 ? 0 : 100 / (max / value) const thumbPadRight = (thumbPosPercent / 100) * THUMB_WIDTH const markPosPercent = 100 / (max / (marginThreshold ?? 1)) const markPadRight = (markPosPercent / 100) * THUMB_WIDTH const hasPastMarginThreshold = marginThreshold ? value >= marginThreshold : undefined return ( <>
{Array.from(Array(9).keys()).map((i) => (
))} {marginThreshold && (
Margin
)}
{value}
) } const className = { inputThumbOverlay: ` w-[33px] h-4 absolute text-[10px] top-[5px] pointer-events-none text-center font-bold bg-pink shadow-md border-b-0 border-1 border-solid rounded-sm backdrop-blur-sm border-white/10 `, mark: `w-1 h-1 bg-black rounded-full bg-opacity-30`, marginMark: `w-1 h-1 bg-white rounded-full`, marginMarkContainer: 'absolute w-[33px] flex justify-center', marginMarkOverlay: 'absolute top-2.5 flex-col text-xs w-[33px] items-center flex', marksWrapper: `absolute flex-1 flex w-full justify-evenly bg-no-repeat top-[8.5px] pointer-events-none pt-[2.5px] pb-[2.5px] rounded-lg`, } export default InputOverlay