mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-08 14:38:47 +00:00
first public source commit
This commit is contained in:
parent
1a4fbb9d42
commit
3914fee775
65 changed files with 4697 additions and 312 deletions
21
src/components/widget.jsx
Normal file
21
src/components/widget.jsx
Normal file
|
@ -0,0 +1,21 @@
|
|||
import Weather from "components/widgets/weather/weather";
|
||||
import Resources from "components/widgets/resources/resources";
|
||||
|
||||
const widgetMappings = {
|
||||
weather: Weather,
|
||||
resources: Resources,
|
||||
};
|
||||
|
||||
export default function Widget({ widget }) {
|
||||
const ServiceWidget = widgetMappings[widget.type];
|
||||
|
||||
if (ServiceWidget) {
|
||||
return <ServiceWidget options={widget.options} />;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="flex-none flex flex-row items-center justify-center">
|
||||
Missing <strong>{widget.type}</strong>
|
||||
</div>
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue