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);
}

export function viewOnceLabel(fileType?: string): string {
  switch (fileType) {
    case "image":
      return "عکس یک‌بار مصرف";
    case "video":
      return "فیلم یک‌بار مصرف";
    case "voice":
      return "ویس یک‌بار مصرف";
    default:
      return "پیام یک‌بار مصرف";
  }
}
