wip 10
This commit is contained in:
@@ -42,14 +42,14 @@ export default function AdminImportPage() {
|
||||
},
|
||||
},
|
||||
{
|
||||
onSuccess: (response) => {
|
||||
onSuccess: _response => {
|
||||
showInfo('Import completed successfully');
|
||||
// Redirect to import results page after a short delay
|
||||
setTimeout(() => {
|
||||
window.location.href = '/admin/import-results';
|
||||
}, 1500);
|
||||
},
|
||||
onError: (error) => {
|
||||
onError: error => {
|
||||
showError('Import failed: ' + (error as any).message);
|
||||
},
|
||||
}
|
||||
@@ -68,19 +68,13 @@ export default function AdminImportPage() {
|
||||
return (
|
||||
<div className="overflow-x-auto">
|
||||
<div className="inline-block min-w-full overflow-hidden rounded shadow">
|
||||
<div
|
||||
className="flex grow flex-col gap-2 rounded bg-white p-4 text-gray-500 shadow-lg dark:bg-gray-700 dark:text-white"
|
||||
>
|
||||
<p className="text-lg font-semibold text-gray-500">
|
||||
Selected Import Directory
|
||||
</p>
|
||||
<div className="flex grow flex-col gap-2 rounded bg-white p-4 text-gray-500 shadow-lg dark:bg-gray-700 dark:text-white">
|
||||
<p className="text-lg font-semibold text-gray-500">Selected Import Directory</p>
|
||||
<form className="flex flex-col gap-4" onSubmit={handleImport}>
|
||||
<div className="flex w-full justify-between gap-4">
|
||||
<div className="flex items-center gap-4">
|
||||
<FolderOpen size={20} />
|
||||
<p className="break-all text-lg font-medium">
|
||||
{selectedDirectory}
|
||||
</p>
|
||||
<p className="break-all text-lg font-medium">{selectedDirectory}</p>
|
||||
</div>
|
||||
<div className="mr-4 flex flex-col justify-around gap-2">
|
||||
<div className="inline-flex items-center gap-2">
|
||||
@@ -126,17 +120,11 @@ export default function AdminImportPage() {
|
||||
return (
|
||||
<div className="overflow-x-auto">
|
||||
<div className="inline-block min-w-full overflow-hidden rounded shadow">
|
||||
<table
|
||||
className="min-w-full bg-white text-sm leading-normal dark:bg-gray-700"
|
||||
>
|
||||
<table className="min-w-full bg-white text-sm leading-normal dark:bg-gray-700">
|
||||
<thead className="text-gray-800 dark:text-gray-400">
|
||||
<tr>
|
||||
<th
|
||||
className="w-12 border-b border-gray-200 p-3 text-left font-normal dark:border-gray-800"
|
||||
></th>
|
||||
<th
|
||||
className="break-all border-b border-gray-200 p-3 text-left font-normal dark:border-gray-800"
|
||||
>
|
||||
<th className="w-12 border-b border-gray-200 p-3 text-left font-normal dark:border-gray-800"></th>
|
||||
<th className="break-all border-b border-gray-200 p-3 text-left font-normal dark:border-gray-800">
|
||||
{currentPath}
|
||||
</th>
|
||||
</tr>
|
||||
@@ -144,9 +132,7 @@ export default function AdminImportPage() {
|
||||
<tbody className="text-black dark:text-white">
|
||||
{currentPath !== '/' && (
|
||||
<tr>
|
||||
<td
|
||||
className="border-b border-gray-200 p-3 text-gray-800 dark:text-gray-400"
|
||||
></td>
|
||||
<td className="border-b border-gray-200 p-3 text-gray-800 dark:text-gray-400"></td>
|
||||
<td className="border-b border-gray-200 p-3">
|
||||
<button onClick={handleNavigateUp}>
|
||||
<p>../</p>
|
||||
@@ -156,14 +142,14 @@ export default function AdminImportPage() {
|
||||
)}
|
||||
{directories.length === 0 ? (
|
||||
<tr>
|
||||
<td className="p-3 text-center" colSpan={2}>No Folders</td>
|
||||
<td className="p-3 text-center" colSpan={2}>
|
||||
No Folders
|
||||
</td>
|
||||
</tr>
|
||||
) : (
|
||||
directories.map((item) => (
|
||||
directories.map(item => (
|
||||
<tr key={item.name}>
|
||||
<td
|
||||
className="border-b border-gray-200 p-3 text-gray-800 dark:text-gray-400"
|
||||
>
|
||||
<td className="border-b border-gray-200 p-3 text-gray-800 dark:text-gray-400">
|
||||
<button onClick={() => item.name && handleSelectDirectory(item.name)}>
|
||||
<FolderOpen size={20} />
|
||||
</button>
|
||||
@@ -181,4 +167,4 @@ export default function AdminImportPage() {
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user