✨ 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 CheckBox from "@Front/Components/DesignSystem/CheckBox";
|
||||
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() {
|
||||
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 (
|
||||
<DefaultTemplate title="Nouvelle souscription" hasBackArrow>
|
||||
{subscription && (
|
||||
<div className={classes["root"]}>
|
||||
<Typography typo={ITypo.H2} color={ITypoColor.BLACK}>
|
||||
Choisissez les collaborateurs pour votre abonnement
|
||||
</Typography>
|
||||
<Typography typo={ITypo.P_SB_18} color={ITypoColor.BLACK}>
|
||||
7 sièges disponibles
|
||||
{subscription.nb_seats} sièges disponibles
|
||||
</Typography>
|
||||
<Form>
|
||||
<div className={classes["collaborators-container"]}>
|
||||
@ -90,6 +111,7 @@ export default function SubscriptionManageCollaborators() {
|
||||
</div>
|
||||
</Form>
|
||||
</div>
|
||||
)}
|
||||
</DefaultTemplate>
|
||||
);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user