import { Button, Row } from "antd";
import ProHeader from "components/ProHeader/ProHeader";
import { useTranslation } from "react-i18next";
import { Link, useParams } from "react-router-dom";
import styles from "./orders.module.css";
import OrdersList from "./OrdersList";

export default function OrdersPage() {
  const { t } = useTranslation();
  const { subdomain } = useParams();

  return (
    <>
      <ProHeader>{t("orders.title")}</ProHeader>
      <OrdersList />
      <Row className={styles.row}>
        <Link to={`/${subdomain}/menu`} style={{ width: "100%" }}>
          <Button type="primary" shape="round" className={styles.button}>
            {t("orders.browseMenu")}
          </Button>
        </Link>
      </Row>
    </>
  );
}
