refactor: switch and storagebar ui

This commit is contained in:
Ravinou 2025-01-02 11:18:07 +01:00
commit 349275b908
No known key found for this signature in database
GPG key ID: EEEE670C40F6A4D7
2 changed files with 16 additions and 2 deletions

View file

@ -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(

View file

@ -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}>