forked from Ninjalama/streamyfin_mirror
Signed-off-by: Lance Chant <13349722+lancechant@users.noreply.github.com> Signed-off-by: lancechant <13349722+lancechant@users.noreply.github.com> Co-authored-by: Fredrik Burmester <fredrik.burmester@gmail.com> Co-authored-by: Uruk <contact@uruk.dev> Co-authored-by: Gauvain <68083474+Gauvino@users.noreply.github.com>
30 lines
981 B
TypeScript
30 lines
981 B
TypeScript
import { useRouter } from "expo-router";
|
|
import { useTranslation } from "react-i18next";
|
|
import { View } from "react-native";
|
|
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, _updateSettings] = 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>
|
|
);
|
|
};
|