mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-13 08:20:34 +00:00
Add Immich Widget
This commit is contained in:
parent
e5d65f410c
commit
6b5e8ab0c7
5 changed files with 39 additions and 0 deletions
22
src/widgets/immich/component.jsx
Normal file
22
src/widgets/immich/component.jsx
Normal file
|
@ -0,0 +1,22 @@
|
|||
import Container from "components/services/widget/container";
|
||||
import Block from "components/services/widget/block";
|
||||
import useWidgetAPI from "utils/proxy/use-widget-api";
|
||||
|
||||
export default function Component({ service }) {
|
||||
const { widget } = service;
|
||||
|
||||
const { data: immichData, error: immichError } = useWidgetAPI(widget);
|
||||
|
||||
if (immichError) {
|
||||
return <Container error={immichError} />;
|
||||
}
|
||||
|
||||
return (
|
||||
<Container service={service}>
|
||||
<Block label="immich.users" value={immichData?.usageByUser.length} />
|
||||
<Block label="immich.photos" value={immichData?.photos} />
|
||||
<Block label="immich.videos" value={immichData?.videos} />
|
||||
<Block label="immich.storage" value={immichData?.usage} />
|
||||
</Container>
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue