mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-06 12:18:48 +00:00
first public source commit
This commit is contained in:
parent
1a4fbb9d42
commit
3914fee775
65 changed files with 4697 additions and 312 deletions
27
src/components/services/widget.jsx
Normal file
27
src/components/services/widget.jsx
Normal file
|
@ -0,0 +1,27 @@
|
|||
import Sonarr from "./widgets/sonarr";
|
||||
import Radarr from "./widgets/radarr";
|
||||
import Ombi from "./widgets/ombi";
|
||||
import Portainer from "./widgets/portainer";
|
||||
|
||||
const widgetMappings = {
|
||||
sonarr: Sonarr,
|
||||
radarr: Radarr,
|
||||
ombi: Ombi,
|
||||
portainer: Portainer,
|
||||
};
|
||||
|
||||
export default function Widget({ service }) {
|
||||
const ServiceWidget = widgetMappings[service.widget.type];
|
||||
|
||||
if (ServiceWidget) {
|
||||
return <ServiceWidget service={service} />;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="bg-theme-200/50 dark:bg-theme-900/20 rounded m-1 flex-1 flex flex-col items-center justify-center p-1">
|
||||
<div className="font-thin text-sm">
|
||||
Missing Widget Type: <strong>{service.widget.type}</strong>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue