Merge branch 'main' into default-provider
This commit is contained in:
commit
1884ef33d9
4 changed files with 20 additions and 20 deletions
|
|
@ -350,6 +350,7 @@ export const ChatInput = forwardRef<ChatInputHandle, ChatInputProps>(
|
||||||
onClear={() => {
|
onClear={() => {
|
||||||
onFileSelected(null);
|
onFileSelected(null);
|
||||||
}}
|
}}
|
||||||
|
isUploading={isUploading}
|
||||||
/>
|
/>
|
||||||
</motion.div>
|
</motion.div>
|
||||||
)}
|
)}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,11 @@
|
||||||
import { X } from "lucide-react";
|
import { Loader2, X } from "lucide-react";
|
||||||
import Image from "next/image";
|
import Image from "next/image";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
|
|
||||||
interface FilePreviewProps {
|
interface FilePreviewProps {
|
||||||
uploadedFile: File;
|
uploadedFile: File;
|
||||||
onClear: () => void;
|
onClear: () => void;
|
||||||
|
isUploading?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
const formatFileSize = (bytes: number): string => {
|
const formatFileSize = (bytes: number): string => {
|
||||||
|
|
@ -22,12 +23,14 @@ const getFilePreviewUrl = (file: File): string => {
|
||||||
return "";
|
return "";
|
||||||
};
|
};
|
||||||
|
|
||||||
export const FilePreview = ({ uploadedFile, onClear }: FilePreviewProps) => {
|
export const FilePreview = ({ uploadedFile, onClear, isUploading = false }: FilePreviewProps) => {
|
||||||
return (
|
return (
|
||||||
<div className="max-w-[250px] flex items-center gap-2 p-2 bg-muted rounded-lg">
|
<div className="max-w-[250px] flex items-center gap-2 p-2 bg-muted rounded-lg">
|
||||||
{/* File Image Preview */}
|
{/* File Image Preview */}
|
||||||
<div className="flex-shrink-0 w-8 h-8 bg-background rounded border border-input flex items-center justify-center overflow-hidden">
|
<div className="flex-shrink-0 w-8 h-8 bg-background rounded border border-input flex items-center justify-center overflow-hidden">
|
||||||
{getFilePreviewUrl(uploadedFile) ? (
|
{isUploading ? (
|
||||||
|
<Loader2 className="h-4 w-4 animate-spin text-muted-foreground" />
|
||||||
|
) : getFilePreviewUrl(uploadedFile) ? (
|
||||||
<Image
|
<Image
|
||||||
src={getFilePreviewUrl(uploadedFile)}
|
src={getFilePreviewUrl(uploadedFile)}
|
||||||
alt="File preview"
|
alt="File preview"
|
||||||
|
|
|
||||||
|
|
@ -472,19 +472,15 @@ export function Navigation({
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className="flex-shrink-0 mt-4">
|
{(newConversationFiles?.length ?? 0) !== 0 && (
|
||||||
<div className="flex items-center justify-between mb-3 mx-3">
|
<div className="flex-shrink-0 mt-4">
|
||||||
<h3 className="text-xs font-medium text-muted-foreground">
|
<div className="flex items-center justify-between mb-3 mx-3">
|
||||||
Files
|
<h3 className="text-xs font-medium text-muted-foreground">
|
||||||
</h3>
|
Files
|
||||||
</div>
|
</h3>
|
||||||
<div className="overflow-y-auto scrollbar-hide space-y-1">
|
</div>
|
||||||
{(newConversationFiles?.length ?? 0) === 0 ? (
|
<div className="overflow-y-auto scrollbar-hide space-y-1">
|
||||||
<div className="text-[13px] text-muted-foreground py-2 px-3">
|
{newConversationFiles?.map((file, index) => (
|
||||||
No documents yet
|
|
||||||
</div>
|
|
||||||
) : (
|
|
||||||
newConversationFiles?.map((file, index) => (
|
|
||||||
<div
|
<div
|
||||||
key={`${file}-${index}`}
|
key={`${file}-${index}`}
|
||||||
className="flex-1 min-w-0 px-3"
|
className="flex-1 min-w-0 px-3"
|
||||||
|
|
@ -493,10 +489,10 @@ export function Navigation({
|
||||||
{file}
|
{file}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
))
|
))}
|
||||||
)}
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "openrag"
|
name = "openrag"
|
||||||
version = "0.1.37"
|
version = "0.1.38"
|
||||||
description = "Add your description here"
|
description = "Add your description here"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
requires-python = ">=3.13"
|
requires-python = ">=3.13"
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue