Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

578 B
Raw Blame
import type { MessageAttachmentContext } from "./AttachmentPreview";
import { HtmlFileButton, isHtmlFile } from "./HtmlFilePreview";
import { TableFileButton } from "./TableFilePreview";

export function FilePreviewButton({ path, shownPath, name, message }: { path: string; shownPath?: string; name: string; message: MessageAttachmentContext }) {
  if (isHtmlFile(name) || isHtmlFile(path)) return <HtmlFileButton path={path} shownPath={shownPath} name={name} message={message} />;
  return <TableFileButton path={path} shownPath={shownPath} name={name} message={message} />;
}