Added the option to view both the teachers and students of a corporate as well as the corporate of a student

This commit is contained in:
Tiago Ribeiro
2023-12-03 00:13:50 +00:00
parent 36be5267a2
commit 5c8867555d
8 changed files with 308 additions and 21 deletions

View File

@@ -35,9 +35,10 @@ interface Props {
onClose: (reload?: boolean) => void;
onViewStudents?: () => void;
onViewTeachers?: () => void;
onViewCorporate?: () => void;
}
const UserCard = ({user, loggedInUser, onClose, onViewStudents, onViewTeachers}: Props) => {
const UserCard = ({user, loggedInUser, onClose, onViewStudents, onViewTeachers, onViewCorporate}: Props) => {
const [expiryDate, setExpiryDate] = useState<Date | null | undefined>(user.subscriptionExpirationDate);
const [type, setType] = useState(user.type);
const [status, setStatus] = useState(user.status);
@@ -456,6 +457,11 @@ const UserCard = ({user, loggedInUser, onClose, onViewStudents, onViewTeachers}:
<div className="flex gap-4 justify-between mt-4 w-full">
<div className="self-start flex gap-4 justify-start items-center w-full">
{onViewCorporate && (
<Button className="w-full max-w-[200px]" variant="outline" color="rose" onClick={onViewCorporate}>
View Corporate
</Button>
)}
{onViewStudents && (
<Button className="w-full max-w-[200px]" variant="outline" color="rose" onClick={onViewStudents}>
View Students