diff --git a/frontend/src/views/supervisor/Supervisor.tsx b/frontend/src/views/supervisor/Supervisor.tsx
index 6540b2b..b0f89bd 100644
--- a/frontend/src/views/supervisor/Supervisor.tsx
+++ b/frontend/src/views/supervisor/Supervisor.tsx
@@ -9,6 +9,7 @@ const Supervisor = () => {
{ name: 'Grupy', path: '/supervisor/groups' },
{ name: 'Harmonogram', path: '/supervisor/schedule' },
]}
+ color="bg-amber-300"
/>
diff --git a/frontend/src/views/supervisor/SupervisorGroups.tsx b/frontend/src/views/supervisor/SupervisorGroups.tsx
new file mode 100644
index 0000000..b8aa9e5
--- /dev/null
+++ b/frontend/src/views/supervisor/SupervisorGroups.tsx
@@ -0,0 +1,161 @@
+import classNames from 'classnames'
+import { useEffect, useState } from 'react'
+import { useMutation, useQuery } from 'react-query'
+import { useNavigate } from 'react-router-dom'
+import useLocalStorageState from 'use-local-storage-state'
+import { deleteGroup, getGroups } from '../../api/groups'
+import { ReactComponent as IconRemove } from '../../assets/svg/icon-remove.svg'
+import { Link } from 'react-router-dom'
+
+const SupervisorGroups = () => {
+ let navigate = useNavigate()
+ const [page, setPage] = useState(1)
+ const [perPage, setPerPage] = useState(10)
+ const [yearGroupId] = useLocalStorageState('yearGroupId')
+
+ const perPageOptions = [
+ {
+ value: 10,
+ label: '10 rekordów',
+ },
+ {
+ value: 20,
+ label: '20 rekordów',
+ },
+ {
+ value: 50,
+ label: '50 rekordów',
+ },
+ {
+ value: 1000,
+ label: 'Pokaż wszystkie',
+ },
+ ]
+
+ const {
+ isLoading: areGroupsLoading,
+ data: groups,
+ refetch: refetchGroups,
+ } = useQuery(['groups', page, perPage], () =>
+ getGroups({ year_group_id: Number(yearGroupId), page, per_page: perPage }),
+ )
+
+ const { mutate: mutateDelete } = useMutation(
+ 'deleteGroup',
+ (index: number) => deleteGroup(index),
+ {
+ onSuccess: () => refetchGroups(),
+ },
+ )
+
+ useEffect(() => {
+ setPage(1)
+ }, [perPage])
+
+ if (areGroupsLoading) {
+ return
Ładowanie
+ }
+ return (
+
+
+
+
+
+
+
+
+
+
+
+ Nazwa |
+ Opiekun |
+ Semestr 1 |
+ Semestr 2 |
+ |
+
+
+
+ {groups?.data?.groups?.map(
+ ({
+ id,
+ name,
+ project_supervisor,
+ points_for_first_term,
+ points_for_second_term,
+ }) => (
+
+
+
+ {name}
+
+ |
+
+ {`${project_supervisor.first_name} ${project_supervisor.last_name}`}
+ |
+ {points_for_first_term} |
+ {points_for_second_term} |
+
+
+ |
+
+ ),
+ )}
+
+
+
+
+
+
+ {[
+ ...Array(
+ groups?.data?.max_pages && groups?.data?.max_pages + 1,
+ ).keys(),
+ ]
+ .slice(1)
+ .map((p) => (
+
+ ))}
+
+
+
+
+ )
+}
+
+export default SupervisorGroups