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:
28
lib/utils/book.ts
Normal file
28
lib/utils/book.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import {SelectBoxProps} from "@/components/form/SelectBox";
|
||||
import {SyncedBook} from "@/lib/types/synced-book";
|
||||
|
||||
export function booksToSelectBox(books: SyncedBook[]): SelectBoxProps[] {
|
||||
return books.map((book: SyncedBook): SelectBoxProps => {
|
||||
return {
|
||||
label: book.title,
|
||||
value: book.id,
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
export function getBookTypeLabel(value: string): string {
|
||||
switch (value) {
|
||||
case 'short':
|
||||
return 'bookTypes.short';
|
||||
case 'novelette':
|
||||
return 'bookTypes.novelette';
|
||||
case 'long':
|
||||
return 'bookTypes.novella';
|
||||
case 'chapbook':
|
||||
return 'bookTypes.chapbook';
|
||||
case 'novel':
|
||||
return 'bookTypes.novel';
|
||||
default:
|
||||
return 'bookTypes.novel';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user