2024-03-09 18:48:49 +07:00
|
|
|
import React from "react";
|
2024-03-15 09:05:49 +07:00
|
|
|
import api from "@/lib/api";
|
|
|
|
import { useQuery } from "react-query";
|
|
|
|
import Text from "@ui/Text";
|
|
|
|
import Performance from "./_sections/Performance";
|
|
|
|
import Summary from "./_sections/Summary";
|
|
|
|
import Storage from "./_sections/Storage";
|
|
|
|
import { ScrollView } from "react-native";
|
2024-03-09 18:48:49 +07:00
|
|
|
import { cn } from "@/lib/utils";
|
|
|
|
|
|
|
|
const App = () => {
|
2024-03-15 09:05:49 +07:00
|
|
|
const { data: system } = useQuery({
|
|
|
|
queryKey: ["system"],
|
|
|
|
queryFn: () => api.system.$get().then((r) => r.json()),
|
|
|
|
refetchInterval: 1000,
|
|
|
|
});
|
2024-03-09 18:48:49 +07:00
|
|
|
|
|
|
|
return (
|
2024-03-15 09:05:49 +07:00
|
|
|
<ScrollView
|
|
|
|
contentContainerStyle={cn("px-4 py-8 md:py-16")}
|
|
|
|
showsVerticalScrollIndicator={false}
|
|
|
|
>
|
|
|
|
<Text className="text-2xl font-medium">Home Lab</Text>
|
2024-03-09 18:48:49 +07:00
|
|
|
|
2024-03-15 09:05:49 +07:00
|
|
|
<Summary data={system} />
|
|
|
|
<Performance data={system} />
|
|
|
|
<Storage data={system} />
|
|
|
|
</ScrollView>
|
2024-03-09 18:48:49 +07:00
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default App;
|