import { type Theme } from '@mui/material';

import { type SkeletonProps } from './types';

export const getBorderRadius = (
  variant: SkeletonProps['variant'],
  theme: Theme,
) => {
  // This method repeats MUI's internal code for the 'circular' variant but is necessary to set a diferent border radius default
  switch (variant) {
    case 'circular':
      return '50%';
    case 'rectangular':
      return undefined;
    default:
      return theme.shape.borderRadiusS;
  }
};
