export const VIEW_ONCE_MEDIA_TYPES = ["image", "video", "voice"] as const;

export type ViewOnceMediaType = (typeof VIEW_ONCE_MEDIA_TYPES)[number];

export function isViewOnceMediaType(
  fileType?: string | null
): fileType is ViewOnceMediaType {
  return VIEW_ONCE_MEDIA_TYPES.includes(fileType as ViewOnceMediaType);
}

import type { TFunction } from "i18next";

export function viewOnceLabel(
  fileType: string | undefined,
  t: TFunction
): string {
  switch (fileType) {
    case "image":
      return t("chats.viewOnce.image");
    case "video":
      return t("chats.viewOnce.video");
    case "voice":
      return t("chats.viewOnce.voice");
    default:
      return t("chats.viewOnce.default");
  }
}
