Skip to content

Commit

Permalink
@mui/material/Grid2 (#221)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelquigley committed Oct 29, 2024
1 parent 9867067 commit c84b2a3
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions agent/agentUi/src/Overview.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,33 @@ import {Box, Card, Stack} from "@mui/material";
import AccessCard from "./AccessCard.jsx";
import ShareCard from "./ShareCard.jsx";
import React from "react";
import Grid from '@mui/material/Grid2';

const Overview = (props) => {
let cards = [];
if(props.overview.length > 0) {
props.overview.forEach((row) => {
switch(row.type) {
case "access":
cards.push(<AccessCard key={row.frontendToken} access={row} />);
cards.push(<Grid size={{ xs: 12, md: 6 }}><AccessCard key={row.frontendToken} access={row} /></Grid>);
break;

case "share":
cards.push(<ShareCard key={row.token} share={row} />);
cards.push(<Grid size={{ xs: 12, md: 6 }}><ShareCard key={row.token} share={row} /></Grid>);
break;
}
});
} else {
cards.push(<Card key="empty"><h5>zrok Agent is empty! Add a <a href="#" onClick={props.shareClick}>share <ShareIcon /></a> or <a href={"#"} onClick={props.accessClick}>access <LanIcon /></a> share to get started.</h5></Card>);
cards.push(<Grid size={{ xs: 12 }}>
<Card key="empty">
<h5>zrok Agent is empty! Add a <a href="#" onClick={props.shareClick}>share <ShareIcon /></a> or <a href={"#"} onClick={props.accessClick}>access <LanIcon /></a> share to get started.</h5>
</Card>
</Grid>);
}
return (
<Box sx={{ display: "flex",
flexDirection: "row",
flexWrap: "wrap",
justifyContent: "space-between",
flexGrow: 1
}}>
<Grid container spacing={2}>
{cards}
</Box>
</Grid>
);
}

Expand Down

0 comments on commit c84b2a3

Please sign in to comment.