diff --git a/src/app.rs b/src/app.rs
index f883453..353ff68 100644
--- a/src/app.rs
+++ b/src/app.rs
@@ -4,7 +4,6 @@ use leptos::*;
use leptos_meta::*;
use crate::components::{item_form::ItemForm, items_list::ItemsList, review_form::ReviewForm, reviews_list::ReviewsList };
use crate::models::item::Item;
-use crate::models::review::Review;
use crate::nostr::NostrClient;
use tokio::sync::mpsc;
use uuid::Uuid;
@@ -64,7 +63,7 @@ pub fn App() -> impl IntoView {
// Component to display the list of items.
// Reviews form and list
-
+
>
diff --git a/src/components/reviews_list.rs b/src/components/reviews_list.rs
index 6916ae6..bbefa65 100644
--- a/src/components/reviews_list.rs
+++ b/src/components/reviews_list.rs
@@ -7,11 +7,13 @@ pub fn ReviewsList(reviews: Vec) -> impl IntoView {
{ "Reviews" }
- { for review in reviews {
- view! {
- - { &review.content }
- }
- } }
+ {
+ reviews.into_iter().map(|review| {
+ view! {
+ - { review.content }
+ }
+ }).collect::>()
+ }
}
diff --git a/src/models/item.rs b/src/models/item.rs
index ddace10..337bfef 100644
--- a/src/models/item.rs
+++ b/src/models/item.rs
@@ -1,19 +1,13 @@
/// Represents an Item in CompareWare.
/// Each item has metadata and key-value tags for categorization.
use serde::{Deserialize, Serialize};
-
-pub struct Review {
- pub user_id: String,
- pub title: String,
- pub content: String,
- pub timestamp: i64,
-}
+use crate::models::review::Review;
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct Item {
- pub id: String, // Unique ID for the item
- pub name: String, // Item name
- pub description: String, // Short description of the item
- pub tags: Vec<(String, String)>, // Key-value tags (e.g., "type" -> "software")
- pub reviews: Vec, // Reviews
-}
+ pub id: String,
+ pub name: String,
+ pub description: String,
+ pub tags: Vec<(String, String)>,
+ pub reviews: Vec, // Add reviews field here
+}
\ No newline at end of file