Shortened code for amount change color in Logs.tsx and polished some other stuff

This commit is contained in:
Keannu Christian Bernasol 2023-03-06 00:04:25 +08:00
parent 2a12356820
commit b62a160f88
3 changed files with 69 additions and 33 deletions

View file

@ -0,0 +1,27 @@
import * as React from "react";
import { useState } from "react";
import { Switch } from "@mui/material";
import TableView from "../../Components/ProductsPage/TableView/TableView";
import BlobView from "../../Components/ProductsPage/BlobView/BlobView";
import { ProductList } from "../../Interfaces/Interfaces";
export interface props {}
export default function ViewManager(props: ProductList) {
const [tableView, toggleTableView] = useState(false);
if (tableView) {
return (
<div>
<Switch onClick={() => toggleTableView(!tableView)} />
<TableView Products={props.Products} />
</div>
);
} else {
return (
<div>
<Switch onClick={() => toggleTableView(!tableView)} />
<BlobView Products={props.Products} />
</div>
);
}
}