import { createSignal } from "solid-js";
import { ClassroomCourse } from "../../types/ClassroomCourse";
import { Person } from "../../types/Person";
import { CoursesList } from "./Courses";
import { Message } from "./Message";
import { AccountExpiration } from "./AccountExpiration";

export function ClassroomUserInfo(props: {userid: number, updateSignal: number, person: Person}) {
    const [courses, setCourses] = createSignal<Array<ClassroomCourse>>([]);

    return (
        <div class="flex gap-2 flex-wrap">
            <div>
                <CoursesList
                    userid={props.userid}
                    updateSignal={props.updateSignal}
                    courses={courses()}
                    setCourses={setCourses}
                />

                <AccountExpiration userId={props.userid} />
            </div>

            <Message courses={courses()} person={props.person} />
        </div>
    );
}
