aboutsummaryrefslogtreecommitdiff
path: root/src/app/manage/client/list
diff options
context:
space:
mode:
Diffstat (limited to 'src/app/manage/client/list')
-rw-r--r--src/app/manage/client/list/list_item.rs32
-rw-r--r--src/app/manage/client/list/mod.rs9
2 files changed, 13 insertions, 28 deletions
diff --git a/src/app/manage/client/list/list_item.rs b/src/app/manage/client/list/list_item.rs
index 8b78ad7..2e6fed0 100644
--- a/src/app/manage/client/list/list_item.rs
+++ b/src/app/manage/client/list/list_item.rs
@@ -17,44 +17,22 @@
use yew::prelude::*;
-use crate::app::manage::client::list::address;
-
use crate::models::client;
#[derive(Properties, PartialEq)]
pub struct Props {
pub client: client::Client,
+ pub s_no: usize,
}
#[function_component(ListItem)]
pub fn list_item(props: &Props) -> Html {
html! {
<div class={"clients-list-item"}>
- <div class={"header"}>
- <span class={"client-name"}>{props.client.name.clone()}</span>
- <span class={"client-gstin"}>{props.client.gstin.clone()}</span>
- </div>
-
- <div class={"details"}>
- <div class={"contact-info"}>
- <span class={"title"}>{"Contact Details:"}</span>
- <span>{"Name - "}{props.client.contact.contact_name.clone()}</span>
- <span>{"Phone - "}{props.client.contact.phone_number.clone()}</span>
- <span>{"E-Mail - "}{props.client.contact.email_address.clone()}</span>
- <span>{"Website - "}{props.client.contact.website.clone()}</span>
- </div>
-
- <address::Address title={"Billing Address:"} address={props.client.billing_address.clone()} />
-
- <div class={"shipping-addresses-wrapper"}>
- </div>
- </div>
-
- <div class={"options"}>
- <p>
- {"Options (To Be Added)"}
- </p>
- </div>
+ <span>{props.s_no}</span>
+ <span>{props.client.name.clone()}</span>
+ <span>{props.client.gstin.clone()}</span>
+ <span class={"options"}></span>
</div>
}
}
diff --git a/src/app/manage/client/list/mod.rs b/src/app/manage/client/list/mod.rs
index 2e13be6..1c00f0a 100644
--- a/src/app/manage/client/list/mod.rs
+++ b/src/app/manage/client/list/mod.rs
@@ -31,11 +31,18 @@ pub struct Props {
pub fn clients_list(props: &Props) -> Html {
let list_items: Html = props.clients
.iter()
- .map(|c| html!(<list_item::ListItem key={c.id} client={c.clone()} />))
+ .enumerate()
+ .map(|(id, c)| html!(<list_item::ListItem key={c.id} s_no={id + 1} client={c.clone()} />))
.collect();
html! {
<div class={"clients-list-wrapper"}>
+ <div class={"clients-list-header"}>
+ <span>{"S. No"}</span>
+ <span>{"Client Name"}</span>
+ <span>{"GSTIN"}</span>
+ <span class={"options"}></span>
+ </div>
<div class={"clients-list"}>
{list_items}
</div>