chore: cleaning up workspaces table code (#2765)

* cleaning up workspace table code

* Update site/src/components/WorkspacesTable/WorkspacesTableBody.tsx

Co-authored-by: Joe Previte <jjprevite@gmail.com>

Co-authored-by: Joe Previte <jjprevite@gmail.com>
This commit is contained in:
Kira Pilot
2022-06-30 16:50:15 -04:00
committed by GitHub
co-authored by Joe Previte
parent 29be359f3d
commit ae59f166fd
12 changed files with 310 additions and 235 deletions
@@ -0,0 +1,42 @@
import Table from "@material-ui/core/Table"
import TableBody from "@material-ui/core/TableBody"
import TableCell from "@material-ui/core/TableCell"
import TableHead from "@material-ui/core/TableHead"
import TableRow from "@material-ui/core/TableRow"
import { FC } from "react"
import { WorkspaceItemMachineRef } from "../../xServices/workspaces/workspacesXService"
import { WorkspacesTableBody } from "./WorkspacesTableBody"
const Language = {
name: "Name",
template: "Template",
version: "Version",
lastBuilt: "Last Built",
status: "Status",
}
export interface WorkspacesTableProps {
isLoading?: boolean
workspaceRefs?: WorkspaceItemMachineRef[]
filter?: string
}
export const WorkspacesTable: FC<WorkspacesTableProps> = ({ isLoading, workspaceRefs, filter }) => {
return (
<Table>
<TableHead>
<TableRow>
<TableCell width="35%">{Language.name}</TableCell>
<TableCell width="15%">{Language.template}</TableCell>
<TableCell width="15%">{Language.version}</TableCell>
<TableCell width="20%">{Language.lastBuilt}</TableCell>
<TableCell width="15%">{Language.status}</TableCell>
<TableCell width="1%"></TableCell>
</TableRow>
</TableHead>
<TableBody>
<WorkspacesTableBody isLoading={isLoading} workspaceRefs={workspaceRefs} filter={filter} />
</TableBody>
</Table>
)
}