Add book title to autocomplete suggestions

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Aaron Roberts
2026-06-09 18:29:14 +01:00
parent 5ea18d76d6
commit dc5a1a4ff5
5 changed files with 21 additions and 6 deletions

View File

@@ -274,13 +274,16 @@ function App() {
<datalist id="rv-authors">
{suggestions.authors.map(a => <option key={a} value={a} />)}
</datalist>
<datalist id="rv-books">
{(suggestions.books || []).map(b => <option key={b} value={b} />)}
</datalist>
<datalist id="rv-chapters">
{suggestions.chapters.map(c => <option key={c} value={c} />)}
</datalist>
<div className="grid grid-cols-4 gap-4">
{[
{ key: 'author', label: 'Author', placeholder: 'Author name', list: 'rv-authors' },
{ key: 'book', label: 'Book', placeholder: 'Book title', list: undefined },
{ key: 'book', label: 'Book', placeholder: 'Book title', list: 'rv-books' },
{ key: 'chapter', label: 'Chapter', placeholder: 'Chapter', list: 'rv-chapters' },
{ key: 'page', label: 'Page', placeholder: 'Page number', list: undefined },
].map(({ key, label, placeholder, list }) => (