15 lines
393 B
TypeScript
15 lines
393 B
TypeScript
import * as React from 'react'
|
|
|
|
export interface PJHealthLikeBarProps {
|
|
value: number
|
|
max: number
|
|
}
|
|
export default function PJHealthLikeBar(props: PJHealthLikeBarProps): JSX.Element {
|
|
const percentage = ((props.value / props.max) * 100) + '%';
|
|
return (
|
|
<div className="bar">
|
|
<div className="filled" style={{width: percentage}}></div>
|
|
</div>
|
|
)
|
|
}
|