-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(web/services): Displayed in services page
- Loading branch information
1 parent
651fefe
commit 63e237d
Showing
4 changed files
with
30 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,27 @@ | ||
"use client"; | ||
|
||
import { useAtom } from "jotai"; | ||
import { useEffect } from "react"; | ||
import DashboardPageWrapper from "@/layouts/dashboard/DashboardPageWrapper"; | ||
import { servicesAtom } from "@/stores"; | ||
import services from "@/services"; | ||
import ServicesList from "@/components/editor/ServicesList"; | ||
|
||
const ServicesPage = () => { | ||
const [cachedServices, setCachedServices] = useAtom(servicesAtom); | ||
|
||
useEffect(() => { | ||
(async () => { | ||
const fetchedServices = await services.services.getAll(); | ||
setCachedServices(fetchedServices.data ?? []); | ||
})(); | ||
}, []); | ||
|
||
const ServicesPage = () => <DashboardPageWrapper title="Services" />; | ||
return ( | ||
<DashboardPageWrapper title="Services"> | ||
<ServicesList services={cachedServices} nbPerLine={1} /> | ||
</DashboardPageWrapper> | ||
); | ||
}; | ||
|
||
export default ServicesPage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters