mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-01-15 15:48:05 +00:00
Co-authored-by: Alex Kim <alexkim@Alexs-MacBook-Pro.local> Co-authored-by: Fredrik Burmester <fredrik.burmester@gmail.com> Co-authored-by: Simon-Eklundh <simon.eklundh@proton.me>
30 lines
971 B
TypeScript
30 lines
971 B
TypeScript
import { useTranslation } from "react-i18next";
|
|
import { View } from "react-native";
|
|
import useRouter from "@/hooks/useAppRouter";
|
|
import { useSessions, type useSessionsProps } from "@/hooks/useSessions";
|
|
import { useSettings } from "@/utils/atoms/settings";
|
|
import { ListGroup } from "../list/ListGroup";
|
|
import { ListItem } from "../list/ListItem";
|
|
|
|
export const Dashboard = () => {
|
|
const { settings } = useSettings();
|
|
const { sessions = [] } = useSessions({} as useSessionsProps);
|
|
const router = useRouter();
|
|
|
|
const { t } = useTranslation();
|
|
|
|
if (!settings) return null;
|
|
return (
|
|
<View>
|
|
<ListGroup title={t("home.settings.dashboard.title")} className='mt-4'>
|
|
<ListItem
|
|
className={sessions.length !== 0 ? "bg-purple-900" : ""}
|
|
onPress={() => router.push("/settings/dashboard/sessions")}
|
|
title={t("home.settings.dashboard.sessions_title")}
|
|
showArrow
|
|
/>
|
|
</ListGroup>
|
|
</View>
|
|
);
|
|
};
|