Remove unused components and models for improved maintainability

- Deleted redundant components (`AddActionButton`, `AlertBox`, `AlertStack`, `BackButton`, `CancelButton`, and `CollapsableArea`) and related files.
- Removed unused models (`Book`, `BookSerie`, `BookTables`, `Character`, and `Chapter`) to reduce codebase clutter.
- Updated project structure and references to reflect these removals.
This commit is contained in:
natreex
2026-03-22 22:37:31 -04:00
parent e8aaef108b
commit 64ed90d993
229 changed files with 15091 additions and 21289 deletions

View File

@@ -1,9 +1,9 @@
'use client'
import React, {useState} from 'react';
import {FontAwesomeIcon} from '@fortawesome/react-fontawesome';
import {faDownload, faSpinner} from '@fortawesome/free-solid-svg-icons';
import {useTranslations} from 'next-intl';
import {Download} from 'lucide-react';
import {useTranslations} from '@/lib/i18n';
import SelectBox from '@/components/form/SelectBox';
import InputField from '@/components/form/InputField';
interface SeriesImportItem {
id: string;
@@ -18,19 +18,19 @@ interface SeriesImportSelectorProps {
}
export default function SeriesImportSelector({
availableItems,
onImport,
placeholder,
label
}: SeriesImportSelectorProps) {
availableItems,
onImport,
placeholder,
label
}: SeriesImportSelectorProps) {
const t = useTranslations();
const [selectedId, setSelectedId] = useState<string>('');
const [isImporting, setIsImporting] = useState<boolean>(false);
async function handleImport(): Promise<void> {
if (!selectedId || isImporting) return;
setIsImporting(true);
try {
await onImport(selectedId);
@@ -39,50 +39,36 @@ export default function SeriesImportSelector({
setIsImporting(false);
}
}
if (availableItems.length === 0) {
return null;
}
const selectData = availableItems.map((item) => ({
label: item.name,
value: item.id
}));
return (
<div className="bg-primary/10 border border-primary/30 rounded-xl p-4 mb-4">
{label && (
<h4 className="text-sm font-medium text-primary mb-3 flex items-center gap-2">
<FontAwesomeIcon icon={faDownload} className="w-4 h-4"/>
<Download className="w-4 h-4" strokeWidth={1.75}/>
{label}
</h4>
)}
<div className="flex items-center gap-3">
<div className="flex-grow">
<InputField
input={
<SelectBox
onChangeCallBack={(e) => setSelectedId(e.target.value)}
data={selectData}
defaultValue={selectedId}
placeholder={placeholder}
/>
</div>
<button
onClick={handleImport}
disabled={!selectedId || isImporting}
className={`px-4 py-2 rounded-lg font-medium flex items-center gap-2 transition-all duration-200 ${
selectedId && !isImporting
? 'bg-primary text-white hover:bg-primary-dark hover:scale-105'
: 'bg-secondary/50 text-muted cursor-not-allowed'
}`}
>
{isImporting ? (
<FontAwesomeIcon icon={faSpinner} className="w-4 h-4 animate-spin"/>
) : (
<FontAwesomeIcon icon={faDownload} className="w-4 h-4"/>
)}
{t('seriesImport.importButton')}
</button>
</div>
}
addButtonCallBack={handleImport}
isAddButtonDisabled={!selectedId || isImporting}
/>
</div>
);
}