first public source commit

This commit is contained in:
Ben Phelps 2022-08-24 10:44:35 +03:00
parent 1a4fbb9d42
commit 3914fee775
65 changed files with 4697 additions and 312 deletions

21
src/components/widget.jsx Normal file
View 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>
);
}