import { useWorkspace } from '@/renderer/contexts/workspace'; import { useQuery } from '@/renderer/hooks/use-query'; import { FilePreview } from '@/renderer/components/files/file-preview'; import { FileSidebar } from '@/renderer/components/files/file-sidebar'; import { Button } from '@/renderer/components/ui/button'; import { SquareArrowOutUpRight } from 'lucide-react'; import { FileDownload } from '@/renderer/components/files/file-download'; import { getFileUrl } from '@/lib/files'; interface FileContainerProps { nodeId: string; } export const FileContainer = ({ nodeId }: FileContainerProps) => { const workspace = useWorkspace(); const { data } = useQuery({ type: 'file_get', userId: workspace.userId, fileId: nodeId, }); if (!data) { return null; } const url = getFileUrl(workspace.userId, data.id, data.extension); return (
{data.downloadProgress !== 100 ? ( ) : ( )}
); };