import Box from "@material-ui/core/Box" import Button from "@material-ui/core/Button" 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 React from "react" import { Link } from "react-router-dom" import * as TypesGen from "../../api/typesGenerated" import { EmptyState } from "../EmptyState/EmptyState" import { TableHeaderRow } from "../TableHeaders/TableHeaders" import { TableLoader } from "../TableLoader/TableLoader" import { TableTitle } from "../TableTitle/TableTitle" export const Language = { title: "Workspaces", nameLabel: "Name", emptyMessage: "No workspaces have been created yet", emptyDescription: "Create a workspace to get started", ctaAction: "Create workspace", } export interface WorkspacesTableProps { templateInfo?: TypesGen.Template workspaces?: TypesGen.Workspace[] onCreateWorkspace: () => void } export const WorkspacesTable: React.FC = ({ templateInfo, workspaces, onCreateWorkspace }) => { const isLoading = !templateInfo || !workspaces return ( {Language.nameLabel} {isLoading && } {workspaces && workspaces.map((w) => ( {w.name} ))} {workspaces && workspaces.length === 0 && ( {Language.ctaAction} } /> )}
) }