/
Lisson
/
web_shedule-lesson
Обзор
Документация
Войти
/
Lisson
/
web_shedule-lesson
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/app/components/TableLessons/TableLessons.tsx
62 строки
2 KB
Ruslan
first commit
13 фев 2025, 16:38
13 фев 2025, 16:38
c512e06
Код
Авторство
О чём код?
import getGroups from "@/app/queries/getGroups"; import getLesson from "@/app/queries/getLesson"; import { JSX } from "react"; export const TableLessons = async (): Promise<JSX.Element> => { const queryGroups = await getGroups(); // const queryLessons = await getLesson(new Date("2024-06-17")); const queryLessons = await getLesson(new Date()); // const [selectedGroup, setGroup] = useState<string>(0); return ( <div> <div> <form> <label htmlFor="groups">Группа</label> <select name="groups" id="groups" > {queryGroups.map((query) => ( <option key={query.groupid} >{query.number}</option> ))} </select> </form> </div> <div> <table> {/* <caption>Заголовок</caption> */} <thead> <tr> <th>Дата</th> <th>Время</th> <th>Дисциплина</th> <th>Аудитория</th> <th>Преподаватель</th> <th>Группа</th> <th>Тип урока</th> <th>Кафедра</th> </tr> </thead> <tbody> {queryLessons.map((query) => ( <tr key={query.lessonid}> <td>{query.date_event.toLocaleDateString()}</td> <td>{query.time_event.toLocaleTimeString()}</td> <td>{query.discipline.Name}</td> <td>{query.classroom}</td> <td>{query.teacher.FIO}</td> <td>{query.group.number}</td> <td>{query.type_of_lesson}</td> <td>{query.teacher.cathedra.Name}</td> </tr> ))} </tbody> </table> </div> </div> ); };