mirror of
https://github.com/portainer/portainer.git
synced 2025-07-19 13:29:41 +02:00
chore(react): Convert cluster details to react CE (#466)
This commit is contained in:
parent
dd98097897
commit
7759d762ab
24 changed files with 829 additions and 345 deletions
41
app/react/kubernetes/components/ResourceUsageItem.tsx
Normal file
41
app/react/kubernetes/components/ResourceUsageItem.tsx
Normal file
|
@ -0,0 +1,41 @@
|
|||
import { FormControl } from '@@/form-components/FormControl';
|
||||
import { ProgressBar } from '@@/ProgressBar';
|
||||
|
||||
interface ResourceUsageItemProps {
|
||||
value: number;
|
||||
total: number;
|
||||
annotation?: React.ReactNode;
|
||||
label: string;
|
||||
isLoading?: boolean;
|
||||
dataCy?: string;
|
||||
}
|
||||
|
||||
export function ResourceUsageItem({
|
||||
value,
|
||||
total,
|
||||
annotation,
|
||||
label,
|
||||
isLoading = false,
|
||||
dataCy,
|
||||
}: ResourceUsageItemProps) {
|
||||
return (
|
||||
<FormControl
|
||||
label={label}
|
||||
isLoading={isLoading}
|
||||
className={isLoading ? 'mb-1.5' : ''}
|
||||
dataCy={dataCy}
|
||||
>
|
||||
<div className="flex items-center gap-2 mt-1">
|
||||
<ProgressBar
|
||||
steps={[
|
||||
{
|
||||
value,
|
||||
},
|
||||
]}
|
||||
total={total}
|
||||
/>
|
||||
<div className="text-xs flex shrink-0">{annotation}</div>
|
||||
</div>
|
||||
</FormControl>
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue