All files / pages/Statistics StatisticsIndexPage.jsx

0% Statements 0/0
0% Branches 0/0
0% Functions 1/1
0% Lines 0/0

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54                                                                                                           
import React from "react";
import { Button, Card, Col, Row } from "react-bootstrap";
import { Link } from "react-router";
import BasicLayout from "main/layouts/BasicLayout/BasicLayout";
import { STATISTICS_PAGES } from "main/pages/Statistics/statisticsConstants";
 
export default function StatisticsIndexPage() {
  return (
    <BasicLayout>
      <div className="pt-2">
        <h1>Review Statistics</h1>
        <p>
          Pick a statistic below to help you decide where to eat your next meal.
        </p>
        <Row>
          {STATISTICS_PAGES.map((page) => (
            <Col
              key={page.testid}
              md={6}
              lg={4}
              className="mb-3"
              data-testid={`${page.testid}-col`}
            >
              <Card>
                <Card.Body>
                  <Card.Title>{page.title}</Card.Title>
                  <Card.Text>{page.description}</Card.Text>
                  {page.comingSoon !== false ? (
                    <Button
                      variant="primary"
                      disabled
                      data-testid={page.testid}
                    >
                      Coming Soon
                    </Button>
                  ) : (
                    <Link
                      to={page.to}
                      className="btn btn-primary"
                      data-testid={page.testid}
                    >
                      View
                    </Link>
                  )}
                </Card.Body>
              </Card>
            </Col>
          ))}
        </Row>
      </div>
    </BasicLayout>
  );
}