/* @component-map * App — Main Myreads container with tab navigation * StarRating — Interactive 5-star rating component * BookCard — Displays a saved book with notes editing and removal * DiscoverTab — Form + AI suggestions for finding new books * SuggestionCard — Single AI recommendation with save buttons * BookList — List view for saved books in Want/Read tabs * @end-component-map */ import { useCollection, useAI } from '@deplixo/sdk'; const TABS = ["Discover", "Want to Read", "Previously Read"]; function StarRating({ value, onChange }) { return (
{[1, 2, 3, 4, 5].map((s) => ( onChange?.(s)} className={`star ${(value ?? 0) >= s ? 'star-filled' : ''} ${onChange ? 'star-clickable' : ''}`} > ★ ))}
); } function BookCard({ book, list, onRemove, onUpdateRating, onUpdateNotes }) { const [editing, setEditing] = React.useState(false); const [draft, setDraft] = React.useState(book.notes || ""); const save = () => { onUpdateNotes(book.id, draft); setEditing(false); }; return (
{book.title}
by {book.author}
{list === "read" && onUpdateRating(book.id, r)} />}
Why suggested: {book.reason}
{editing ? (