✨ connect manage collaborators
This commit is contained in:
parent
c777132077
commit
e698f5a781
@ -4,16 +4,37 @@ import DefaultTemplate from "@Front/Components/LayoutTemplates/DefaultTemplate";
|
|||||||
import Form from "@Front/Components/DesignSystem/Form";
|
import Form from "@Front/Components/DesignSystem/Form";
|
||||||
import CheckBox from "@Front/Components/DesignSystem/CheckBox";
|
import CheckBox from "@Front/Components/DesignSystem/CheckBox";
|
||||||
import Button, { EButtonVariant } from "@Front/Components/DesignSystem/Button";
|
import Button, { EButtonVariant } from "@Front/Components/DesignSystem/Button";
|
||||||
|
import { useCallback, useEffect, useState } from "react";
|
||||||
|
import { Subscription } from "le-coffre-resources/dist/Admin";
|
||||||
|
import { useRouter } from "next/router";
|
||||||
|
import JwtService from "@Front/Services/JwtService/JwtService";
|
||||||
|
import Subscriptions from "@Front/Api/LeCoffreApi/Admin/Subscriptions/Subscriptions";
|
||||||
|
|
||||||
export default function SubscriptionManageCollaborators() {
|
export default function SubscriptionManageCollaborators() {
|
||||||
|
const router = useRouter();
|
||||||
|
const [subscription, setSubscription] = useState<Subscription | null>(null);
|
||||||
|
|
||||||
|
const loadSubscription = useCallback(async () => {
|
||||||
|
const jwt = JwtService.getInstance().decodeJwt();
|
||||||
|
const subscription = await Subscriptions.getInstance().get({ where: { office: { uid: jwt?.office_Id } } });
|
||||||
|
console.log(subscription);
|
||||||
|
if (!subscription[0]) return;
|
||||||
|
setSubscription(subscription[0]);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
loadSubscription();
|
||||||
|
}, [loadSubscription]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DefaultTemplate title="Nouvelle souscription" hasBackArrow>
|
<DefaultTemplate title="Nouvelle souscription" hasBackArrow>
|
||||||
|
{subscription && (
|
||||||
<div className={classes["root"]}>
|
<div className={classes["root"]}>
|
||||||
<Typography typo={ITypo.H2} color={ITypoColor.BLACK}>
|
<Typography typo={ITypo.H2} color={ITypoColor.BLACK}>
|
||||||
Choisissez les collaborateurs pour votre abonnement
|
Choisissez les collaborateurs pour votre abonnement
|
||||||
</Typography>
|
</Typography>
|
||||||
<Typography typo={ITypo.P_SB_18} color={ITypoColor.BLACK}>
|
<Typography typo={ITypo.P_SB_18} color={ITypoColor.BLACK}>
|
||||||
7 sièges disponibles
|
{subscription.nb_seats} sièges disponibles
|
||||||
</Typography>
|
</Typography>
|
||||||
<Form>
|
<Form>
|
||||||
<div className={classes["collaborators-container"]}>
|
<div className={classes["collaborators-container"]}>
|
||||||
@ -90,6 +111,7 @@ export default function SubscriptionManageCollaborators() {
|
|||||||
</div>
|
</div>
|
||||||
</Form>
|
</Form>
|
||||||
</div>
|
</div>
|
||||||
|
)}
|
||||||
</DefaultTemplate>
|
</DefaultTemplate>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user