Files
cobble/src/components/general/file-preview-table-cell.tsx
T
tbenandClaude Opus 5.5 faa554d5e3 Open bot files in a preview modal instead of a new tab
Markdown rendered, CSV/TSV as a table, images, PDFs, audio, video and
sandboxed HTML in place, other text as code, with Download and Open in a
new tab. Used by file chips, message attachments, the files modal, task
files and the files browser.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 19:25:49 +01:00

21 lines
607 B
TypeScript

import { twMerge } from "tailwind-merge";
type Props = {
value: string;
header?: boolean;
};
/**
* One cell of a previewed CSV, its text kept to one readable width.
*/
export default function FilePreviewTableCell({ value, header }: Props) {
const className = twMerge(
"px-3 py-1.5 max-w-80 text-left align-top whitespace-pre-wrap wrap-break-word border-0 border-b border-r border-solid border-hairline",
header && "font-bold border-hairline-strong",
);
if (header) return <th className={className}>{value}</th>;
return <td className={className}>{value}</td>;
}