import { FC, memo } from 'react'; const SemiCircleBar: FC<{ stroke?: string; strokeWidth?: number; background?: string; diameter?: number; orientation?: string; direction?: string; showPercentValue?: boolean; percentage: number; }> = ({ stroke = '#02B732', strokeWidth = 15, background = '#5A7486', diameter = 300, orientation = 'up', direction = 'right', showPercentValue = false, percentage }) => { const coordinateForCircle = diameter / 2; const radius = (diameter - 2 * strokeWidth) / 2; const circumference = Math.PI * radius; let percentageValue; if (percentage > 100) { percentageValue = 100; } else if (percentage < 0) { percentageValue = 0; } else { percentageValue = percentage; } const semiCirclePercentage = percentageValue * (circumference / 100); let rotation; if (orientation === 'down') { if (direction === 'left') { rotation = 'rotate(180deg) rotateY(180deg)'; } else { rotation = 'rotate(180deg)'; } } else { if (direction === 'right') { rotation = 'rotateY(180deg)'; } } return (
Achieved