zulip/web/src/narrow_error.ts
Prakhar Pratyush 22efac5a77 empty_feed_notice: Add support for empty string topic.
Earlier, we were not showing `realm_empty_topic_display_name`
value in the empty_feed_notice.
2025-02-18 09:47:13 -08:00

30 lines
770 B
TypeScript

import render_empty_feed_notice from "../templates/empty_feed_notice.hbs";
type QueryWord = {
query_word: string;
is_stop_word: boolean;
};
export type SearchData = {
query_words: QueryWord[];
has_stop_word: boolean;
stream_query?: string;
topic_query?: string;
is_empty_string_topic?: boolean;
};
export type NarrowBannerData = {
title: string;
html?: string;
search_data?: SearchData;
};
export function narrow_error(narrow_banner_data: NarrowBannerData): string {
const title = narrow_banner_data.title;
const html = narrow_banner_data.html;
const search_data = narrow_banner_data.search_data;
const empty_feed_notice = render_empty_feed_notice({title, html, search_data});
return empty_feed_notice;
}