export const pxToNumber = (px: string) => { if (px && px.includes('px')) { const match = px.match(/(\d+)px/); const n = match ? parseInt(match[1], 10) : 0; if (!isNaN(n)) return n; return n; } return 0; };