reorganize code into smaller files & dirs

This commit is contained in:
Martti Malmi
2024-01-04 15:48:19 +02:00
parent 5ea2eb711f
commit afa6d39a56
321 changed files with 671 additions and 671 deletions

View File

@ -0,0 +1,23 @@
.progress {
position: relative;
height: 1em;
border-radius: 4px;
overflow: hidden;
background-color: var(--gray);
}
.progress > div {
position: absolute;
background-color: var(--success);
width: var(--progress);
height: 100%;
}
.progress > span {
position: absolute;
width: 100%;
height: 100%;
text-align: center;
font-size: small;
line-height: 1em;
}

View File

@ -0,0 +1,21 @@
import "./Progress.css";
import { FormattedNumber } from "react-intl";
import { CSSProperties, ReactNode } from "react";
export default function Progress({ value, status }: { value: number; status?: ReactNode }) {
const v = Math.max(0.01, Math.min(1, value));
return (
<div className="progress">
<div
style={
{
"--progress": `${v * 100}%`,
} as CSSProperties
}></div>
<span>
{status}
<FormattedNumber value={v} style="percent" />
</span>
</div>
);
}