Files
Hayden Bleasel c3a2eaaca7 V1.2 misc fixes (#105)
* Add type safety to remark plugins

* Move harden-react-markdown defaults to props

* Change switch to if to avoid default clause

* Use save-file for table

* Use for-of

* Write custom save function

* Remove use of state in image

* Update image.tsx

* Use existing save function

* Create khaki-facts-fly.md
2025-09-04 21:25:45 -07:00

16 lines
572 B
TypeScript

import { type ClassValue, clsx } from 'clsx';
import { twMerge } from 'tailwind-merge';
export const cn = (...inputs: ClassValue[]) => twMerge(clsx(inputs));
export const save = (filename: string, content: string | Blob, mimeType: string) => {
const blob = typeof content === 'string' ? new Blob([content], { type: mimeType }) : content;
const url = URL.createObjectURL(blob);
const a = document.createElement("a");
a.href = url;
a.download = filename;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
URL.revokeObjectURL(url);
};