13 lines
640 B
TypeScript
13 lines
640 B
TypeScript
// Metro module 8530 (f8531).
|
|
import Module8531, { Circle } from "../../../../_bundle/Module8531";
|
|
export default function OpenCriticRatingCircle(props) {
|
|
const { rating, strokeColor, size } = props;
|
|
const cx = size / 2;
|
|
const r4 = (size - 4) / 2;
|
|
const strokeDasharray = 2 * Math.PI * r4;
|
|
const r44 = 1 - Math.min(Math.max(rating, 0), 100) / 100;
|
|
return <Module8531 width={size} height={size}>
|
|
<Circle transform={`rotate(${360 * r44 / 2} ${cx} ${cx})`} cx={cx} cy={cx} r={r4} stroke={strokeColor} strokeWidth={2} fill="none" strokeDasharray={strokeDasharray} strokeDashoffset={strokeDasharray * r44} />
|
|
</Module8531>;
|
|
};
|