Files
archie/ui/src/logs/logs-empty.ts
T

28 lines
876 B
TypeScript

// What the logs list says when it has nothing to show: a dead stream, a
// deployment with no durable history, or filters that match nothing.
import { errors } from "@/copy/errors";
/** logsEmptyTitle names the situation. */
export function logsEmptyTitle(
durableUnavailable: boolean,
streamState: string,
): string {
if (streamState === "unavailable") return errors.logs.empty.streamUnavailable;
if (durableUnavailable) return "No logs yet";
return "Nothing matches";
}
/** The line under the title: what to expect next. */
export function logsEmptyDetail(
durableUnavailable: boolean,
streamState: string,
): string {
if (streamState === "unavailable") {
return errors.logs.empty.streamUnavailableDetail;
}
if (durableUnavailable) {
return "This deployment keeps no durable history.";
}
return "Try a wider level or clear the search.";
}