Skip to content

Commit

Permalink
refactor: small change
Browse files Browse the repository at this point in the history
  • Loading branch information
felixmosh committed Oct 10, 2024
1 parent 352ca02 commit 2dd2d38
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/ui/src/components/JobCard/Progress/Progress.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ interface ProgressProps {
}

export const Progress = ({ progress, status, className, strokeWidth = 6 }: ProgressProps) => {
const percentage = typeof progress === 'number' ? progress : progress.progress ?? null;
if (!percentage) {
return null;
}

const commonProps = {
cx: '50%',
cy: '50%',
Expand All @@ -20,9 +25,6 @@ export const Progress = ({ progress, status, className, strokeWidth = 6 }: Progr
['transform-origin']: 'center',
};

const percentage = typeof progress === 'number' ? progress : progress.progress ?? null;
if(!percentage) return null

return (
<svg className={cn(s.progress, className)} width="100%" height="100%">
<circle stroke="#E5E7EB" {...commonProps} />
Expand Down

0 comments on commit 2dd2d38

Please sign in to comment.