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

const user_type = 2;
export default function EditLoanRequest() {
    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: "EditLoanRequest.edit_loan_request_page",
            isBot,
        },
    };
}
