✨ connect manage collaborators
This commit is contained in:
parent
c777132077
commit
e698f5a781
@ -4,92 +4,114 @@ 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>
|
||||
<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
|
||||
</Typography>
|
||||
<Form>
|
||||
<div className={classes["collaborators-container"]}>
|
||||
<CheckBox
|
||||
option={{
|
||||
label: "Jean Dupont",
|
||||
value: "Jean Dupont",
|
||||
}}
|
||||
name="collaborators"
|
||||
/>
|
||||
<CheckBox
|
||||
option={{
|
||||
label: "Jean Dupont",
|
||||
value: "Jean Dupont",
|
||||
}}
|
||||
name="collaborators"
|
||||
/>
|
||||
<CheckBox
|
||||
option={{
|
||||
label: "Jean Dupont",
|
||||
value: "Jean Dupont",
|
||||
}}
|
||||
name="collaborators"
|
||||
checked
|
||||
/>
|
||||
<CheckBox
|
||||
option={{
|
||||
label: "Jean Dupont",
|
||||
value: "Jean Dupont",
|
||||
}}
|
||||
name="collaborators"
|
||||
/>
|
||||
<CheckBox
|
||||
option={{
|
||||
label: "Jean Dupont",
|
||||
value: "Jean Dupont",
|
||||
}}
|
||||
name="collaborators"
|
||||
checked
|
||||
/>
|
||||
<CheckBox
|
||||
option={{
|
||||
label: "Jean Dupont",
|
||||
value: "Jean Dupont",
|
||||
}}
|
||||
name="collaborators"
|
||||
checked
|
||||
/>
|
||||
<CheckBox
|
||||
option={{
|
||||
label: "Jean Dupont",
|
||||
value: "Jean Dupont",
|
||||
}}
|
||||
name="collaborators"
|
||||
/>
|
||||
<CheckBox
|
||||
option={{
|
||||
label: "Jean Dupont",
|
||||
value: "Jean Dupont",
|
||||
}}
|
||||
name="collaborators"
|
||||
/>
|
||||
</div>
|
||||
<Typography typo={ITypo.CAPTION_14} color={ITypoColor.BLACK}>
|
||||
7 collaborateurs sélectionnés
|
||||
{subscription && (
|
||||
<div className={classes["root"]}>
|
||||
<Typography typo={ITypo.H2} color={ITypoColor.BLACK}>
|
||||
Choisissez les collaborateurs pour votre abonnement
|
||||
</Typography>
|
||||
<div className={classes["buttons-container"]}>
|
||||
<Button variant={EButtonVariant.PRIMARY} fullwidth>
|
||||
Enregistrer
|
||||
</Button>
|
||||
<Button variant={EButtonVariant.GHOST} fullwidth>
|
||||
Annuler
|
||||
</Button>
|
||||
</div>
|
||||
</Form>
|
||||
</div>
|
||||
<Typography typo={ITypo.P_SB_18} color={ITypoColor.BLACK}>
|
||||
{subscription.nb_seats} sièges disponibles
|
||||
</Typography>
|
||||
<Form>
|
||||
<div className={classes["collaborators-container"]}>
|
||||
<CheckBox
|
||||
option={{
|
||||
label: "Jean Dupont",
|
||||
value: "Jean Dupont",
|
||||
}}
|
||||
name="collaborators"
|
||||
/>
|
||||
<CheckBox
|
||||
option={{
|
||||
label: "Jean Dupont",
|
||||
value: "Jean Dupont",
|
||||
}}
|
||||
name="collaborators"
|
||||
/>
|
||||
<CheckBox
|
||||
option={{
|
||||
label: "Jean Dupont",
|
||||
value: "Jean Dupont",
|
||||
}}
|
||||
name="collaborators"
|
||||
checked
|
||||
/>
|
||||
<CheckBox
|
||||
option={{
|
||||
label: "Jean Dupont",
|
||||
value: "Jean Dupont",
|
||||
}}
|
||||
name="collaborators"
|
||||
/>
|
||||
<CheckBox
|
||||
option={{
|
||||
label: "Jean Dupont",
|
||||
value: "Jean Dupont",
|
||||
}}
|
||||
name="collaborators"
|
||||
checked
|
||||
/>
|
||||
<CheckBox
|
||||
option={{
|
||||
label: "Jean Dupont",
|
||||
value: "Jean Dupont",
|
||||
}}
|
||||
name="collaborators"
|
||||
checked
|
||||
/>
|
||||
<CheckBox
|
||||
option={{
|
||||
label: "Jean Dupont",
|
||||
value: "Jean Dupont",
|
||||
}}
|
||||
name="collaborators"
|
||||
/>
|
||||
<CheckBox
|
||||
option={{
|
||||
label: "Jean Dupont",
|
||||
value: "Jean Dupont",
|
||||
}}
|
||||
name="collaborators"
|
||||
/>
|
||||
</div>
|
||||
<Typography typo={ITypo.CAPTION_14} color={ITypoColor.BLACK}>
|
||||
7 collaborateurs sélectionnés
|
||||
</Typography>
|
||||
<div className={classes["buttons-container"]}>
|
||||
<Button variant={EButtonVariant.PRIMARY} fullwidth>
|
||||
Enregistrer
|
||||
</Button>
|
||||
<Button variant={EButtonVariant.GHOST} fullwidth>
|
||||
Annuler
|
||||
</Button>
|
||||
</div>
|
||||
</Form>
|
||||
</div>
|
||||
)}
|
||||
</DefaultTemplate>
|
||||
);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user