mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-27 17:56:25 +02:00
feat: add public chat links settings page
This commit is contained in:
parent
ea2dd20a78
commit
67f797232e
4 changed files with 29 additions and 2 deletions
|
|
@ -1,7 +1,7 @@
|
|||
"use client";
|
||||
|
||||
import { useAtomValue } from "jotai";
|
||||
import { Globe, Info } from "lucide-react";
|
||||
import { AlertCircle, Globe, Info } from "lucide-react";
|
||||
import { useCallback, useMemo, useState } from "react";
|
||||
import { toast } from "sonner";
|
||||
import { deletePublicChatSnapshotMutationAtom } from "@/atoms/public-chat-snapshots/public-chat-snapshots-mutation.atoms";
|
||||
|
|
@ -23,7 +23,7 @@ export function PublicChatSnapshotsManager({
|
|||
const [deletingId, setDeletingId] = useState<number | undefined>();
|
||||
|
||||
// Data fetching
|
||||
const { data: snapshotsData, isLoading, refetch } = useAtomValue(publicChatSnapshotsAtom);
|
||||
const { data: snapshotsData, isLoading, isError, refetch } = useAtomValue(publicChatSnapshotsAtom);
|
||||
|
||||
// Permissions
|
||||
const { data: access } = useAtomValue(myAccessAtom);
|
||||
|
|
@ -84,6 +84,18 @@ export function PublicChatSnapshotsManager({
|
|||
);
|
||||
}
|
||||
|
||||
// Error state
|
||||
if (isError) {
|
||||
return (
|
||||
<Alert variant="destructive">
|
||||
<AlertCircle className="h-4 w-4" />
|
||||
<AlertDescription>
|
||||
Failed to load public chat links. Please try again later.
|
||||
</AlertDescription>
|
||||
</Alert>
|
||||
);
|
||||
}
|
||||
|
||||
// Permission denied
|
||||
if (!canView) {
|
||||
return (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue