xylabs/sdk-react

View on GitHub
packages/shared/src/hooks/useSpacing.tsx

Summary

Maintainability
A
0 mins
Test Coverage
import { useTheme } from '@mui/material'

export const useSpacing = (value: string | number) => {
  const theme = useTheme()
  return theme.spacing(typeof value === 'string' ? Number.parseInt(value) : value)
}