Skip to content

Scheduling infrastructure for absolutely everyone.

fix: empty state search messaging event page (#19064)

Tushar Bhatt0522af0c8873
diff --git a/apps/web/modules/event-types/views/event-types-listing-view.tsx b/apps/web/modules/event-types/views/event-types-listing-view.tsx
index d5b42ba4ecc..8fc5acd87c3 100644
--- a/apps/web/modules/event-types/views/event-types-listing-view.tsx
+++ b/apps/web/modules/event-types/views/event-types-listing-view.tsx
@@ -457,9 +457,9 @@ export const InfiniteEventTypeList = ({
if (isPending) return <InfiniteSkeletonLoader />;
return group.teamId ? (
- <EmptyEventTypeList group={group} />
+ <EmptyEventTypeList group={group} searchTerm={debouncedSearchTerm} />
) : !group.profile.eventTypesLockedByOrg ? (
- <CreateFirstEventTypeView slug={group.profile.slug ?? ""} />
+ <CreateFirstEventTypeView slug={group.profile.slug ?? ""} searchTerm={debouncedSearchTerm} />
) : (
<></>
);
@@ -818,13 +818,13 @@ export const InfiniteEventTypeList = ({
);
};
-const CreateFirstEventTypeView = ({ slug }: { slug: string }) => {
+const CreateFirstEventTypeView = ({ slug, searchTerm }: { slug: string; searchTerm?: string }) => {
const { t } = useLocale();
return (
<EmptyScreen
Icon="link"
- headline={t("new_event_type_heading")}
+ headline={searchTerm ? t("no_result_found_for", { searchTerm }) : t("new_event_type_heading")}
description={t("new_event_type_description")}
className="mb-16"
buttonRaw={
@@ -863,12 +863,18 @@ const CTA = ({
);
};
-const EmptyEventTypeList = ({ group }: { group: EventTypeGroup | InfiniteEventTypeGroup }) => {
+const EmptyEventTypeList = ({
+ group,
+ searchTerm,
+}: {
+ group: EventTypeGroup | InfiniteEventTypeGroup;
+ searchTerm?: string;
+}) => {
const { t } = useLocale();
return (
<>
<EmptyScreen
- headline={t("team_no_event_types")}
+ headline={searchTerm ? t("no_result_found_for", { searchTerm }) : t("team_no_event_types")}
buttonRaw={
<Button
href={`?dialog=new&eventPage=${group.profile.slug}&teamId=${group.teamId}`}
diff --git a/apps/web/public/static/locales/en/common.json b/apps/web/public/static/locales/en/common.json
index 7f2a6fc1e67..8338ae45b52 100644
--- a/apps/web/public/static/locales/en/common.json
+++ b/apps/web/public/static/locales/en/common.json
@@ -108,6 +108,7 @@
"accept_license": "Accept License",
"still_waiting_for_approval": "An event is still waiting for approval",
"event_is_still_waiting": "Event request is still waiting: {{attendeeName}} - {{date}} - {{eventType}}",
+ "no_result_found_for": "No result found for \"{{searchTerm}}\"",
"no_more_results": "No more results",
"no_results": "No results",
"load_more_results": "Load more results",