From 4a580d713621f99abb8baabc9b847ce039d44842 Mon Sep 17 00:00:00 2001 From: Mohamed Bassem Date: Sat, 4 Oct 2025 13:40:24 +0100 Subject: feat: Revamp import experience (#2001) * WIP: import v2 * remove new session button * don't redirect after import * store and lint to root list * models + tests * redesign the progress * simplify the import session for ow * drop status from session schema * split the import session page * i18n * fix test * remove pagination * fix some colors in darkmode * one last fix * add privacy filter * privacy check * fix interactivity of import progress * fix test --- .../components/settings/ImportSessionsSection.tsx | 79 ++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 apps/web/components/settings/ImportSessionsSection.tsx (limited to 'apps/web/components/settings/ImportSessionsSection.tsx') diff --git a/apps/web/components/settings/ImportSessionsSection.tsx b/apps/web/components/settings/ImportSessionsSection.tsx new file mode 100644 index 00000000..38f248d2 --- /dev/null +++ b/apps/web/components/settings/ImportSessionsSection.tsx @@ -0,0 +1,79 @@ +"use client"; + +import { Card, CardContent } from "@/components/ui/card"; +import { useListImportSessions } from "@/lib/hooks/useImportSessions"; +import { useTranslation } from "@/lib/i18n/client"; +import { Package } from "lucide-react"; + +import { FullPageSpinner } from "../ui/full-page-spinner"; +import { ImportSessionCard } from "./ImportSessionCard"; + +export function ImportSessionsSection() { + const { t } = useTranslation(); + const { data: sessions, isLoading, error } = useListImportSessions(); + + if (isLoading) { + return ( +
+
+

+ {t("settings.import_sessions.title")} +

+
+ +
+ ); + } + + if (error) { + return ( +
+
+

+ {t("settings.import_sessions.title")} +

+
+ + +

+ {t("settings.import_sessions.load_error")} +

+
+
+
+ ); + } + + return ( +
+
+

+ {t("settings.import_sessions.title")} +

+

+ {t("settings.import_sessions.description")} +

+
+ + {sessions && sessions.length > 0 ? ( +
+ {sessions.map((session) => ( + + ))} +
+ ) : ( + + + +

+ {t("settings.import_sessions.no_sessions")} +

+

+ {t("settings.import_sessions.no_sessions_detail")} +

+
+
+ )} +
+ ); +} -- cgit v1.3-1-g0d28