import BagSearchWrapper from "@/components/BagSearch/BagSearchWrapper";
import { I18nProvider, getServerI18n } from "@/i18n";
import { Stack, Typography } from "@mui/material";
import { Metadata } from "next";
import React, { Suspense } from "react";

export const metadata: Metadata = {
    title: "Bag Usage Records"
}

const bagPage: React.FC = async () => {
    const { t } = await getServerI18n("bagUsage");

    return (
        <>
            <Stack
                direction="row"
                justifyContent="space-between"
                flexWrap="wrap"
                rowGap={2}
            >
                <Typography variant="h4" marginInlineEnd={2}>
                    {t("Bag Usage")}
                </Typography>
            </Stack>
            <I18nProvider namespaces={["bagUsage","navigation","common","jo"]}>
                <Suspense fallback={<BagSearchWrapper.Loading />}>
                    <BagSearchWrapper />
                </Suspense>
            </I18nProvider>
        </>
    )
}

export default bagPage;