From d329bd778959baae443a3da0bcfc106baae98df1 Mon Sep 17 00:00:00 2001 From: rajun Date: Tue, 28 Jul 2026 11:02:18 +0530 Subject: [PATCH] refactor: enhance FileOrUrlField with reusable UI components and existing file support --- app/components/FileOrUrlField.tsx | 40 ++++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/app/components/FileOrUrlField.tsx b/app/components/FileOrUrlField.tsx index baedabe..613ca29 100644 --- a/app/components/FileOrUrlField.tsx +++ b/app/components/FileOrUrlField.tsx @@ -1,4 +1,6 @@ import { Upload, Link, X } from 'lucide-react'; +import { Input } from '~/components/ui/input'; +import { Label } from '~/components/ui/label'; export type InputMode = 'url' | 'file'; @@ -14,21 +16,24 @@ export interface FileOrUrlFieldProps { url: string; onUrlChange: (u: string) => void; urlPlaceholder: string; + existingFileName?: string; + onClearExistingFile?: () => void; } export function FileOrUrlField({ label, required, mode, onModeChange, accept, file, onFileChange, inputRef, url, onUrlChange, urlPlaceholder, + existingFileName, onClearExistingFile, }: FileOrUrlFieldProps) { return (
{/* Label + toggle */}
-