import * as React from "react";
import Grid from "@material-ui/core/Grid";
import Typography from "@material-ui/core/Typography";
import Button from "@material-ui/core/Button";
import Card from '@material-ui/core/Card';
import CardActions from '@material-ui/core/CardActions';
import CardContent from '@material-ui/core/CardContent';
import { Link } from "react-router-dom";
import { ILevel } from "../models/lesson";
interface IProps {
levels: ILevel[];
}
export default class Dashboard extends React.Component<{}> {
constructor(props: any) {
super(props);
}
render() {
const small = window.matchMedia("(max-width: 700px)").matches;
const cName = small ? "lesson-card-xs" : "lesson-card-lg";
let key = 0;
const levelToCard = (level: ILevel) => {
return
{`Level ${level.level}`}
{level.name}
{level.desc}
;
};
return
{this.props.levels.map(levelToCard)}
}
};