export default function getComponentForShare(contentType: string, filename: string) { if (contentType.startsWith("image/")) { return import("./opener/Image.svelte"); } if (contentType.startsWith("video/")) { return import("./opener/Default.svelte"); } if (contentType.startsWith("audio/")) { return import("./opener/Default.svelte"); } if (contentType.startsWith("application/pdf")) { return import("./opener/Default.svelte"); } if (contentType.startsWith("text/")) { return import("./opener/Text.svelte"); } switch (contentType) { case "application/json": case "application/ld+json": case "application/xhtml+xml": case "application/xml": return import("./opener/Default.svelte"); case "application/ogg": return import("./opener/Default.svelte"); } const extension = filename.split(".").pop(); if (extension === undefined) { return import("./opener/Default.svelte"); } switch (extension) { case "png": case "jpg": case "jpeg": case "gif": return import("./opener/Image.svelte"); case "mp4": case "mov": case "avi": case "mkv": case "wmv": case "flv": case "mpg": case "mpeg": return import("./opener/Default.svelte"); case "mp3": case "wav": case "ogg": case "flac": return import("./opener/Default.svelte"); case "pdf": return import("./opener/Default.svelte"); case "txt": case "md": case "markdown": return import("./opener/Default.svelte"); } return import("./opener/Text.svelte"); }