Skip to content

Commit 387d223

Browse files
committed
fixed document page scroll
1 parent 394856d commit 387d223

File tree

1 file changed

+93
-87
lines changed

1 file changed

+93
-87
lines changed

frontend/src/pages/DocumentPage.tsx

Lines changed: 93 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,9 @@ export function DocumentPage() {
139139

140140
return (
141141
<Layout>
142-
<div className="space-y-6">
142+
<div className="flex h-full min-h-0 flex-col">
143143
{/* Header */}
144-
<div className="flex justify-between items-center">
144+
<div className="flex-shrink-0 flex justify-between items-center mb-6">
145145
<h1 className="text-2xl font-semibold text-slate-100">Documents</h1>
146146
{isTenant && (
147147
<Button onClick={() => setIsUploadModalOpen(true)}>
@@ -150,98 +150,104 @@ export function DocumentPage() {
150150
)}
151151
</div>
152152
{/* Files List */}
153-
<div className="bg-slate-800 border border-slate-700 rounded-xl p-6">
154-
{filesIsLoading ? (
155-
<div className="text-center py-12 text-slate-400">Loading...</div>
156-
) : files && files.length > 0 ? (
157-
<div className="space-y-3">
158-
{files.map(file => (
159-
<div
160-
key={file.id}
161-
className="flex items-center justify-between p-4 bg-slate-700 rounded-lg"
162-
>
163-
<div className="flex items-center space-x-3">
164-
<svg
165-
className="w-8 h-8 text-slate-400"
166-
fill="none"
167-
stroke="currentColor"
168-
viewBox="0 0 24 24"
169-
>
170-
<path
171-
strokeLinecap="round"
172-
strokeLinejoin="round"
173-
strokeWidth={2}
174-
d="M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"
175-
/>
176-
</svg>
177-
<div>
178-
<p className="text-slate-100 font-medium">{file.name}</p>
179-
<p className="text-sm text-slate-400">
180-
{file.created_at
181-
? new Date(file.created_at).toLocaleDateString()
182-
: 'No Created At'}
183-
</p>
153+
<div className="flex-1 min-h-0 overflow-y-auto">
154+
<div className="bg-slate-800 border border-slate-700 rounded-xl p-6">
155+
{filesIsLoading ? (
156+
<div className="text-center py-12 text-slate-400">Loading...</div>
157+
) : files && files.length > 0 ? (
158+
<div className="space-y-3">
159+
{files.map(file => (
160+
<div
161+
key={file.id}
162+
className="flex items-center justify-between p-4 bg-slate-700 rounded-lg"
163+
>
164+
<div className="flex items-center space-x-3">
165+
<svg
166+
className="w-8 h-8 text-slate-400"
167+
fill="none"
168+
stroke="currentColor"
169+
viewBox="0 0 24 24"
170+
>
171+
<path
172+
strokeLinecap="round"
173+
strokeLinejoin="round"
174+
strokeWidth={2}
175+
d="M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"
176+
/>
177+
</svg>
178+
<div>
179+
<p className="text-slate-100 font-medium">
180+
{file.name}
181+
</p>
182+
<p className="text-sm text-slate-400">
183+
{file.created_at
184+
? new Date(file.created_at).toLocaleDateString()
185+
: 'No Created At'}
186+
</p>
187+
</div>
184188
</div>
185-
</div>
186-
<div className="flex items-center space-x-2">
187-
{isAdmin && <StatusBadge status={getFileStatus(file.id)} />}
188-
{isAdmin && (
189+
<div className="flex items-center space-x-2">
190+
{isAdmin && (
191+
<StatusBadge status={getFileStatus(file.id)} />
192+
)}
193+
{isAdmin && (
194+
<Button
195+
variant="primary"
196+
size="sm"
197+
onClick={() => handleRetryExtract(file)}
198+
loading={isRetryingExtract}
199+
>
200+
Retry
201+
</Button>
202+
)}
203+
{}
189204
<Button
190205
variant="primary"
191206
size="sm"
192-
onClick={() => handleRetryExtract(file)}
193-
loading={isRetryingExtract}
194-
>
195-
Retry
196-
</Button>
197-
)}
198-
{}
199-
<Button
200-
variant="primary"
201-
size="sm"
202-
onClick={() => handleView(file)}
203-
>
204-
View
205-
</Button>
206-
{isTenant && (
207-
<Button
208-
variant="danger"
209-
size="sm"
210-
onClick={() => handleDelete(file.id)}
211-
loading={isDeletingFile}
207+
onClick={() => handleView(file)}
212208
>
213-
Delete
209+
View
214210
</Button>
215-
)}
211+
{isTenant && (
212+
<Button
213+
variant="danger"
214+
size="sm"
215+
onClick={() => handleDelete(file.id)}
216+
loading={isDeletingFile}
217+
>
218+
Delete
219+
</Button>
220+
)}
221+
</div>
216222
</div>
217-
</div>
218-
))}
219-
</div>
220-
) : (
221-
<div className="text-center py-12">
222-
<svg
223-
className="mx-auto h-16 w-16 text-slate-600 mb-4"
224-
stroke="currentColor"
225-
fill="none"
226-
viewBox="0 0 48 48"
227-
>
228-
<path
229-
d="M28 8H12a4 4 0 00-4 4v20m32-12v8m0 0v8a4 4 0 01-4 4H12a4 4 0 01-4-4v-4m32-4l-3.172-3.172a4 4 0 00-5.656 0L28 28M8 32l9.172-9.172a4 4 0 015.656 0L28 28m0 0l4 4m4-24h8m-4-4v8m-12 4h.02"
230-
strokeWidth={1.5}
231-
strokeLinecap="round"
232-
strokeLinejoin="round"
233-
/>
234-
</svg>
235-
<h3 className="text-lg font-medium text-slate-300 mb-2">
236-
No documents yet
237-
</h3>
238-
<p className="text-slate-400">
239-
{isTenant
240-
? 'Upload files to get started with data processing'
241-
: 'No files uploaded for this tenant'}
242-
</p>
243-
</div>
244-
)}
223+
))}
224+
</div>
225+
) : (
226+
<div className="text-center py-12">
227+
<svg
228+
className="mx-auto h-16 w-16 text-slate-600 mb-4"
229+
stroke="currentColor"
230+
fill="none"
231+
viewBox="0 0 48 48"
232+
>
233+
<path
234+
d="M28 8H12a4 4 0 00-4 4v20m32-12v8m0 0v8a4 4 0 01-4 4H12a4 4 0 01-4-4v-4m32-4l-3.172-3.172a4 4 0 00-5.656 0L28 28M8 32l9.172-9.172a4 4 0 015.656 0L28 28m0 0l4 4m4-24h8m-4-4v8m-12 4h.02"
235+
strokeWidth={1.5}
236+
strokeLinecap="round"
237+
strokeLinejoin="round"
238+
/>
239+
</svg>
240+
<h3 className="text-lg font-medium text-slate-300 mb-2">
241+
No documents yet
242+
</h3>
243+
<p className="text-slate-400">
244+
{isTenant
245+
? 'Upload files to get started with data processing'
246+
: 'No files uploaded for this tenant'}
247+
</p>
248+
</div>
249+
)}
250+
</div>
245251
</div>
246252
{/* Upload Modal */}
247253
{isTenant && (

0 commit comments

Comments
 (0)