Package updates, Overview page
This commit is contained in:
parent
c1d8ff9049
commit
9c568f40cd
2 changed files with 104 additions and 49 deletions
|
|
@ -1,7 +1,62 @@
|
|||
import { useEffect, useState } from "react";
|
||||
|
||||
import UnderConstruction from "@/components/static_pages/UnderConstruction";
|
||||
import RoundedContainer from "@/components/ui/RoundedContainer";
|
||||
import { getServices } from "@/lib/api/helpers/services";
|
||||
import { Project, Service, User } from "@/lib/api/types";
|
||||
import { getUsers } from "@/lib/api/helpers/users";
|
||||
|
||||
export default function Overview() {
|
||||
return(
|
||||
<UnderConstruction />
|
||||
)
|
||||
}
|
||||
const [projectStatus, setProjectStatus] = useState<boolean>(true);
|
||||
const [projects, setProjects] = useState<Project[]>();
|
||||
/*useEffect(() => {
|
||||
getProjects()
|
||||
.then((projects) => {
|
||||
if (projects.length > 0) {
|
||||
setProjects(projects);
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
setProjectStatus(false);
|
||||
});
|
||||
}, []); IMPLEMENT GET PROJECTS */
|
||||
const [serviceStatus, setServiceStatus] = useState<boolean>(true);
|
||||
const [services, setServices] = useState<Service[]>();
|
||||
useEffect(() => {
|
||||
getServices()
|
||||
.then((services) => {
|
||||
if (services.length > 0) {
|
||||
setServices(services);
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
setServiceStatus(false);
|
||||
});
|
||||
}, []);
|
||||
const [userStatus, setUserStatus] = useState<boolean>(true);
|
||||
const [users, setUsers] = useState<User[]>();
|
||||
useEffect(() => {
|
||||
getUsers()
|
||||
.then((users) => {
|
||||
if (users.length > 0) {
|
||||
setUsers(users);
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
setUserStatus(false);
|
||||
});
|
||||
}, []);
|
||||
return (
|
||||
<div>
|
||||
<RoundedContainer>
|
||||
<p>Users</p>
|
||||
</RoundedContainer>
|
||||
<RoundedContainer>
|
||||
<p>Services</p>
|
||||
</RoundedContainer>
|
||||
<RoundedContainer>
|
||||
<p>Projects</p>
|
||||
</RoundedContainer>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue