mirror of
https://github.com/formbricks/formbricks.git
synced 2025-12-30 10:19:51 -06:00
feat: Added a not-connected state to the survey state indicator
feat: Added a not-connected state to the survey state indicator
This commit is contained in:
@@ -81,7 +81,12 @@ export default async function SurveysList({ environmentId }: { environmentId: st
|
||||
<div className="flex items-center">
|
||||
{survey.status !== "draft" && (
|
||||
<>
|
||||
<SurveyStatusIndicator status={survey.status} tooltip environment={environment} />
|
||||
<SurveyStatusIndicator
|
||||
status={survey.status}
|
||||
tooltip
|
||||
environment={environment}
|
||||
type={survey.type}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
{survey.status === "draft" && (
|
||||
|
||||
@@ -2,16 +2,32 @@
|
||||
|
||||
import { TEnvironment } from "@formbricks/types/v1/environment";
|
||||
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@formbricks/ui";
|
||||
import { ArchiveBoxIcon, CheckIcon, PauseIcon } from "@heroicons/react/24/solid";
|
||||
import { ArchiveBoxIcon, CheckIcon, PauseIcon, ExclamationTriangleIcon } from "@heroicons/react/24/solid";
|
||||
|
||||
interface SurveyStatusIndicatorProps {
|
||||
status: string;
|
||||
tooltip?: boolean;
|
||||
environment: TEnvironment;
|
||||
type: string;
|
||||
}
|
||||
|
||||
export default function SurveyStatusIndicator({ status, tooltip, environment }: SurveyStatusIndicatorProps) {
|
||||
if (!environment.widgetSetupCompleted) return null;
|
||||
export default function SurveyStatusIndicator({
|
||||
status,
|
||||
tooltip,
|
||||
environment,
|
||||
type,
|
||||
}: SurveyStatusIndicatorProps) {
|
||||
if (!environment.widgetSetupCompleted) {
|
||||
if (type === "web") {
|
||||
return (
|
||||
<div>
|
||||
<ExclamationTriangleIcon className="h-4 w-4 text-amber-500" />
|
||||
</div>
|
||||
);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
if (tooltip) {
|
||||
return (
|
||||
<TooltipProvider>
|
||||
|
||||
Reference in New Issue
Block a user