aboutsummaryrefslogtreecommitdiffstats
path: root/apps/web/components/dashboard/preview/LinkContentSection.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'apps/web/components/dashboard/preview/LinkContentSection.tsx')
-rw-r--r--apps/web/components/dashboard/preview/LinkContentSection.tsx6
1 files changed, 4 insertions, 2 deletions
diff --git a/apps/web/components/dashboard/preview/LinkContentSection.tsx b/apps/web/components/dashboard/preview/LinkContentSection.tsx
index a0a6f580..53559aa0 100644
--- a/apps/web/components/dashboard/preview/LinkContentSection.tsx
+++ b/apps/web/components/dashboard/preview/LinkContentSection.tsx
@@ -1,4 +1,3 @@
-import { useState } from "react";
import Image from "next/image";
import Link from "next/link";
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
@@ -26,6 +25,7 @@ import {
ExpandIcon,
Video,
} from "lucide-react";
+import { useQueryState } from "nuqs";
import { ErrorBoundary } from "react-error-boundary";
import {
@@ -108,7 +108,9 @@ export default function LinkContentSection({
const availableRenderers = contentRendererRegistry.getRenderers(bookmark);
const defaultSection =
availableRenderers.length > 0 ? availableRenderers[0].id : "cached";
- const [section, setSection] = useState<string>(defaultSection);
+ const [section, setSection] = useQueryState("section", {
+ defaultValue: defaultSection,
+ });
if (bookmark.content.type != BookmarkTypes.LINK) {
throw new Error("Invalid content type");