Skip to content

Commit 68d9e67

Browse files
committed
update empty states
1 parent c8fad05 commit 68d9e67

File tree

1 file changed

+29
-4
lines changed

1 file changed

+29
-4
lines changed

apps/web/ui/modals/link-builder/utm-templates-combo.tsx

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
import useWorkspace from "@/lib/swr/use-workspace";
44
import { UtmTemplateProps } from "@/lib/types";
55
import { UTM_PARAMETERS } from "@/ui/links/utm-builder";
6-
import { Combobox, Tooltip } from "@dub/ui";
7-
import { Note } from "@dub/ui/src/icons";
6+
import { Button, Combobox, Tooltip } from "@dub/ui";
7+
import { DiamondTurnRight } from "@dub/ui/src/icons";
88
import { fetcher, getParamsFromURL } from "@dub/utils";
9+
import { useRouter } from "next/navigation";
910
import { Fragment } from "react";
1011
import { useFormContext } from "react-hook-form";
1112
import { toast } from "sonner";
@@ -83,8 +84,8 @@ export function UTMTemplatesCombo({
8384
}}
8485
placeholder="Templates"
8586
searchPlaceholder="Load or save a template..."
86-
emptyState="No templates found"
87-
icon={Note}
87+
emptyState={<NoUTMTemplatesFound />}
88+
icon={DiamondTurnRight}
8889
createLabel={(search) => `Save new template: "${search}"`}
8990
onCreate={async (search) => {
9091
try {
@@ -121,3 +122,27 @@ export function UTMTemplatesCombo({
121122
/>
122123
);
123124
}
125+
126+
const NoUTMTemplatesFound = () => {
127+
const router = useRouter();
128+
const { slug } = useWorkspace();
129+
130+
return (
131+
<div className="flex h-full flex-col items-center justify-center gap-2 px-2 py-4 text-center text-sm">
132+
<div className="flex items-center justify-center rounded-2xl border border-gray-200 bg-gray-50 p-3">
133+
<DiamondTurnRight className="size-6 text-gray-700" />
134+
</div>
135+
<p className="mt-2 font-medium text-gray-950">No UTM templates found</p>
136+
<p className="mx-auto mt-1 w-full max-w-[180px] text-gray-700">
137+
Add a UTM template to easily create links with the same UTM parameters.
138+
</p>
139+
<div>
140+
<Button
141+
className="mt-1 h-8"
142+
onClick={() => router.push(`/${slug}/settings/library/utm`)}
143+
text="Add UTM template"
144+
/>
145+
</div>
146+
</div>
147+
);
148+
};

0 commit comments

Comments
 (0)