import { type FC } from "hono/jsx"; import type { Book } from "../../types"; import { BOOK_STATUS } from "../../constants"; import { Card, CardBody, CardActions } from "./cards"; import { BookCard, normalizeBookData } from "./BookCard"; const toDateValue = (date: string | null | undefined) => date ? new Date(date).toISOString().slice(0, 10) : ""; const DateInputForm: FC<{ book: Book; field: "startedAt" | "finishedAt"; redirectUrl?: string; }> = ({ book, field, redirectUrl }) => { return (
); }; const RatingSelect: FC<{ book: Book; redirectUrl?: string; }> = ({ book, redirectUrl }) => { return ( ); }; const StatusSelect: FC<{ book: Book; redirectUrl?: string; }> = ({ book, redirectUrl }) => { const statuses = [ { value: BOOK_STATUS.FINISHED, label: "Read" }, { value: BOOK_STATUS.READING, label: "Reading" }, { value: BOOK_STATUS.WANTTOREAD, label: "Want to Read" }, { value: BOOK_STATUS.ABANDONED, label: "Abandoned" }, ]; return ( ); }; export const EditableLibraryTable: FC<{ books: Book[]; redirectUrl?: string; }> = ({ books, redirectUrl }) => { if (!books.length) { return (No books in your library yet. Start adding books to see them here!
| Book | Status | Rating | Dates | Actions |
|---|---|---|---|---|
{book.title}{book.authors.split("\t").join(", ")} |
|
|
|