format
This commit is contained in:
@@ -13,5 +13,3 @@ export function getContentString(content: Message["content"]): string {
|
|||||||
.map((c) => c.text);
|
.map((c) => c.text);
|
||||||
return texts.join(" ");
|
return texts.join(" ");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -9,14 +9,20 @@ export const SUPPORTED_IMAGE_TYPES = [
|
|||||||
"image/gif",
|
"image/gif",
|
||||||
"image/webp",
|
"image/webp",
|
||||||
];
|
];
|
||||||
export const SUPPORTED_FILE_TYPES = [...SUPPORTED_IMAGE_TYPES, "application/pdf"];
|
export const SUPPORTED_FILE_TYPES = [
|
||||||
|
...SUPPORTED_IMAGE_TYPES,
|
||||||
|
"application/pdf",
|
||||||
|
];
|
||||||
|
|
||||||
interface UseFileUploadOptions {
|
interface UseFileUploadOptions {
|
||||||
initialBlocks?: Base64ContentBlock[];
|
initialBlocks?: Base64ContentBlock[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export function useFileUpload({ initialBlocks = [] }: UseFileUploadOptions = {}) {
|
export function useFileUpload({
|
||||||
const [contentBlocks, setContentBlocks] = useState<Base64ContentBlock[]>(initialBlocks);
|
initialBlocks = [],
|
||||||
|
}: UseFileUploadOptions = {}) {
|
||||||
|
const [contentBlocks, setContentBlocks] =
|
||||||
|
useState<Base64ContentBlock[]>(initialBlocks);
|
||||||
const dropRef = useRef<HTMLDivElement>(null);
|
const dropRef = useRef<HTMLDivElement>(null);
|
||||||
|
|
||||||
const isDuplicate = (file: File, blocks: Base64ContentBlock[]) => {
|
const isDuplicate = (file: File, blocks: Base64ContentBlock[]) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user