diff --git a/apps/web/app/(app)/components/LoadingCard.tsx b/apps/web/app/(app)/components/LoadingCard.tsx
new file mode 100644
index 0000000000..be6d80c073
--- /dev/null
+++ b/apps/web/app/(app)/components/LoadingCard.tsx
@@ -0,0 +1,24 @@
+import { SettingsCard } from "@/app/(app)/environments/[environmentId]/settings/components/SettingsCard";
+import { cn } from "@formbricks/lib/cn";
+
+export const LoadingCard = ({
+ title,
+ description,
+ skeletonLines,
+}: {
+ title: string;
+ description: string;
+ skeletonLines: Array<{ classes: string }>;
+}) => {
+ return (
+
+
+ {skeletonLines.map((line, index) => (
+
+ ))}
+
+
+ );
+};
diff --git a/apps/web/app/(app)/environments/[environmentId]/product/(setup)/app-connection/loading.tsx b/apps/web/app/(app)/environments/[environmentId]/product/(setup)/app-connection/loading.tsx
index 9e23ba1582..14b4abf000 100644
--- a/apps/web/app/(app)/environments/[environmentId]/product/(setup)/app-connection/loading.tsx
+++ b/apps/web/app/(app)/environments/[environmentId]/product/(setup)/app-connection/loading.tsx
@@ -1,138 +1,46 @@
"use client";
-import { BrushIcon, KeyIcon, LanguagesIcon, ListChecksIcon, TagIcon, UsersIcon } from "lucide-react";
-import { usePathname } from "next/navigation";
-import { cn } from "@formbricks/lib/cn";
+import { LoadingCard } from "@/app/(app)/components/LoadingCard";
+import { ProductConfigNavigation } from "@/app/(app)/environments/[environmentId]/product/components/ProductConfigNavigation";
import { PageContentWrapper } from "@formbricks/ui/components/PageContentWrapper";
import { PageHeader } from "@formbricks/ui/components/PageHeader";
-const LoadingCard = ({ title, description, skeletonLines }) => {
- return (
-
-
@@ -37,85 +35,14 @@ const LoadingCard = () => {
};
const Loading = () => {
- const pathname = usePathname();
-
- let navigation = [
- {
- id: "general",
- label: "General",
- icon:
,
- current: pathname?.includes("/general"),
- },
- {
- id: "look",
- label: "Look & Feel",
- icon:
,
- current: pathname?.includes("/look"),
- },
- {
- id: "languages",
- label: "Survey Languages",
- icon:
,
- hidden: true,
- current: pathname?.includes("/languages"),
- },
- {
- id: "tags",
- label: "Tags",
- icon:
,
- current: pathname?.includes("/tags"),
- },
- {
- id: "api-keys",
- label: "API Keys",
- icon:
,
- current: pathname?.includes("/api-keys"),
- },
- {
- id: "website-connection",
- label: "Website Connection",
- icon:
,
- current: pathname?.includes("/website-connection"),
- hidden: true,
- },
- {
- id: "app-connection",
- label: "App Connection",
- icon:
,
- current: pathname?.includes("/app-connection"),
- hidden: true,
- },
- ];
-
return (
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
);
};
diff --git a/apps/web/app/(app)/environments/[environmentId]/product/components/ProductConfigNavigation.tsx b/apps/web/app/(app)/environments/[environmentId]/product/components/ProductConfigNavigation.tsx
index 3086183502..9fa6d6ea04 100644
--- a/apps/web/app/(app)/environments/[environmentId]/product/components/ProductConfigNavigation.tsx
+++ b/apps/web/app/(app)/environments/[environmentId]/product/components/ProductConfigNavigation.tsx
@@ -5,15 +5,17 @@ import { usePathname } from "next/navigation";
import { SecondaryNavigation } from "@formbricks/ui/components/SecondaryNavigation";
interface ProductConfigNavigationProps {
- environmentId: string;
activeId: string;
- isMultiLanguageAllowed: boolean;
+ environmentId?: string;
+ isMultiLanguageAllowed?: boolean;
+ loading?: boolean;
}
export const ProductConfigNavigation = ({
- environmentId,
activeId,
+ environmentId,
isMultiLanguageAllowed,
+ loading,
}: ProductConfigNavigationProps) => {
const pathname = usePathname();
let navigation = [
@@ -62,5 +64,5 @@ export const ProductConfigNavigation = ({
},
];
- return
;
+ return
;
};
diff --git a/apps/web/app/(app)/environments/[environmentId]/product/general/loading.tsx b/apps/web/app/(app)/environments/[environmentId]/product/general/loading.tsx
index 003e74e32d..5fc318e862 100644
--- a/apps/web/app/(app)/environments/[environmentId]/product/general/loading.tsx
+++ b/apps/web/app/(app)/environments/[environmentId]/product/general/loading.tsx
@@ -1,34 +1,11 @@
"use client";
-import { BrushIcon, KeyIcon, LanguagesIcon, ListChecksIcon, TagIcon, UsersIcon } from "lucide-react";
-import { usePathname } from "next/navigation";
-import { cn } from "@formbricks/lib/cn";
+import { LoadingCard } from "@/app/(app)/components/LoadingCard";
+import { ProductConfigNavigation } from "@/app/(app)/environments/[environmentId]/product/components/ProductConfigNavigation";
import { PageContentWrapper } from "@formbricks/ui/components/PageContentWrapper";
import { PageHeader } from "@formbricks/ui/components/PageHeader";
-const LoadingCard = ({ title, description, skeletonLines }) => {
- return (
-
-
-
{title}
-
{description}
-
-
-
- {skeletonLines.map((line, index) => (
-
- ))}
-
-
-
- );
-};
-
const Loading = () => {
- const pathname = usePathname();
-
const cards = [
{
title: "Product Name",
@@ -48,83 +25,15 @@ const Loading = () => {
},
];
- let navigation = [
- {
- id: "general",
- label: "General",
- icon:
,
- current: pathname?.includes("/general"),
- },
- {
- id: "look",
- label: "Look & Feel",
- icon:
,
- current: pathname?.includes("/look"),
- },
- {
- id: "languages",
- label: "Survey Languages",
- icon:
,
- hidden: true,
- current: pathname?.includes("/languages"),
- },
- {
- id: "tags",
- label: "Tags",
- icon:
,
- current: pathname?.includes("/tags"),
- },
- {
- id: "api-keys",
- label: "API Keys",
- icon:
,
- current: pathname?.includes("/api-keys"),
- },
- {
- id: "website-connection",
- label: "Website Connection",
- icon:
,
- current: pathname?.includes("/website-connection"),
- hidden: true,
- },
- {
- id: "app-connection",
- label: "App Connection",
- icon:
,
- current: pathname?.includes("/app-connection"),
- hidden: true,
- },
- ];
-
return (
-
-
-
-
-
-
-
-
- {cards.map((card, index) => (
-
- ))}
-
-
+
+
+
+
+ {cards.map((card, index) => (
+
+ ))}
+
);
};
diff --git a/apps/web/app/(app)/environments/[environmentId]/product/languages/loading.tsx b/apps/web/app/(app)/environments/[environmentId]/product/languages/loading.tsx
new file mode 100644
index 0000000000..f5e2b5dd26
--- /dev/null
+++ b/apps/web/app/(app)/environments/[environmentId]/product/languages/loading.tsx
@@ -0,0 +1,33 @@
+"use client";
+
+import { ProductConfigNavigation } from "@/app/(app)/environments/[environmentId]/product/components/ProductConfigNavigation";
+import { SettingsCard } from "@/app/(app)/environments/[environmentId]/settings/components/SettingsCard";
+import { LanguageLabels } from "@formbricks/ee/multi-language/components/language-labels";
+import { PageContentWrapper } from "@formbricks/ui/components/PageContentWrapper";
+import { PageHeader } from "@formbricks/ui/components/PageHeader";
+
+const Loading = () => {
+ return (
+
+
+
+
+
+
+
+ {[...Array(3)].map((_, idx) => (
+
+ ))}
+
+
+
+ );
+};
+
+export default Loading;
diff --git a/apps/web/app/(app)/environments/[environmentId]/product/look/loading.tsx b/apps/web/app/(app)/environments/[environmentId]/product/look/loading.tsx
index 7a65221abf..d00e3ae99d 100644
--- a/apps/web/app/(app)/environments/[environmentId]/product/look/loading.tsx
+++ b/apps/web/app/(app)/environments/[environmentId]/product/look/loading.tsx
@@ -1,8 +1,7 @@
"use client";
+import { ProductConfigNavigation } from "@/app/(app)/environments/[environmentId]/product/components/ProductConfigNavigation";
import { SettingsCard } from "@/app/(app)/environments/[environmentId]/settings/components/SettingsCard";
-import { BrushIcon, KeyIcon, LanguagesIcon, ListChecksIcon, TagIcon, UsersIcon } from "lucide-react";
-import { usePathname } from "next/navigation";
import { cn } from "@formbricks/lib/cn";
import { Badge } from "@formbricks/ui/components/Badge";
import { Button } from "@formbricks/ui/components/Button";
@@ -21,202 +20,140 @@ const placements = [
];
const Loading = () => {
- const pathname = usePathname();
-
- let navigation = [
- {
- id: "general",
- label: "General",
- icon:
,
- current: pathname?.includes("/general"),
- },
- {
- id: "look",
- label: "Look & Feel",
- icon:
,
- current: pathname?.includes("/look"),
- },
- {
- id: "languages",
- label: "Survey Languages",
- icon:
,
- hidden: true,
- current: pathname?.includes("/languages"),
- },
- {
- id: "tags",
- label: "Tags",
- icon:
,
- current: pathname?.includes("/tags"),
- },
- {
- id: "api-keys",
- label: "API Keys",
- icon:
,
- current: pathname?.includes("/api-keys"),
- },
- {
- id: "website-connection",
- label: "Website Connection",
- icon:
,
- current: pathname?.includes("/website-connection"),
- hidden: true,
- },
- {
- id: "app-connection",
- label: "App Connection",
- icon:
,
- current: pathname?.includes("/app-connection"),
- hidden: true,
- },
- ];
-
return (
-
-
-
-
-