feat(item_list): add search button for Wikidata suggestions

This commit is contained in:
ryan 2025-01-08 14:58:12 +03:00
parent 139ea0805c
commit 123d3ef271
3 changed files with 24 additions and 0 deletions

View file

@ -132,3 +132,20 @@ th {
.editable-cell-suggestions li:hover {
background-color: #f5f5f5; /* Light gray background on hover */
}
.search-icon {
margin-left: 10px;
padding: 5px;
border: none;
background-color: transparent;
cursor: pointer;
}
.search-icon i {
font-size: 18px;
color: #333;
}
.search-icon i.fas.fa-search {
margin-left: 5px;
}

View file

@ -29,6 +29,7 @@ pub fn App() -> impl IntoView {
view! {
<Stylesheet href="/assets/style.css" />
<Stylesheet href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css" />
<div>
<h1>{ "CompareWare" }</h1>
<ItemsList items=items_signal set_items=set_items />

View file

@ -192,6 +192,12 @@ pub fn ItemsList(
});
}))
/>
<button class="search-icon" on:click=move |_| {
log!("Search icon clicked, showing suggestions");
set_show_suggestions.set(true);
}>
<i class="fas fa-search"></i> Search Wiki
</button>
{move || {
if show_suggestions.get() {
log!("Rendering suggestions list");