import WithAuthMiddleware from "@/middlewares/WithAuth";
import {parse} from "next-useragent";
import UserTypeMiddleware from "@/middlewares/UserType";
import LoanRequestComponent from "@/components/dashboard/navgan/add-request-loan";

const user_type = 1;
export default function AddLoanRequest() {
    return (
        <WithAuthMiddleware>
            <UserTypeMiddleware user_type={user_type}>
                <LoanRequestComponent/>
            </UserTypeMiddleware>
        </WithAuthMiddleware>
    );
}

export async function getServerSideProps({req, locale}) {
    const {isBot} = parse(req.headers["user-agent"]);
    return {
        props: {
            messages: (await import(`&/locales/${locale}/app.json`)).default,
            title: "LoanRequest.loan_request_page",
            isBot,
        },
    };
}
