mirror of
https://github.com/Ravinou/borgwarehouse
synced 2026-03-14 14:25:46 +01:00
refactor: ⚡ switch and storagebar ui
This commit is contained in:
parent
12de337017
commit
349275b908
2 changed files with 16 additions and 2 deletions
|
|
@ -1,7 +1,12 @@
|
|||
//Lib
|
||||
import classes from './StorageBar.module.css';
|
||||
|
||||
export default function StorageBar(props) {
|
||||
type StorageBarProps = {
|
||||
storageUsed: number;
|
||||
storageSize: number;
|
||||
};
|
||||
|
||||
export default function StorageBar(props: StorageBarProps) {
|
||||
//Var
|
||||
//storageUsed is in kB, storageSize is in GB. Round to 1 decimal for %.
|
||||
const storageUsedPercent = (((props.storageUsed / 1024 ** 2) * 100) / props.storageSize).toFixed(
|
||||
|
|
|
|||
|
|
@ -1,7 +1,16 @@
|
|||
//Lib
|
||||
import { Optional } from '~/types';
|
||||
import classes from './Switch.module.css';
|
||||
|
||||
export default function Switch(props) {
|
||||
type SwitchProps = {
|
||||
switchName: string;
|
||||
switchDescription: string;
|
||||
checked: Optional<boolean>;
|
||||
disabled: boolean;
|
||||
onChange: (checked: boolean) => void;
|
||||
};
|
||||
|
||||
export default function Switch(props: SwitchProps) {
|
||||
return (
|
||||
<>
|
||||
<div className={classes.switchWrapper}>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue