Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -53,14 +53,19 @@ if keywords:
|
|
| 53 |
if "Products" in data and data["Products"]:
|
| 54 |
st.header("Search Results")
|
| 55 |
|
| 56 |
-
|
| 57 |
st.subheader(product["Description"]["ProductDescription"])
|
| 58 |
st.write(f"**Manufacturer**: {product['Manufacturer']['Name']}")
|
| 59 |
st.write(f"**Product Number**: {product['ManufacturerProductNumber']}")
|
| 60 |
st.write(f"**Unit Price**: ${product['UnitPrice']}")
|
| 61 |
st.write(f"[Datasheet]({product['DatasheetUrl']})")
|
| 62 |
st.write(f"[Product Link]({product['ProductUrl']})")
|
| 63 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
st.write("---")
|
| 65 |
else:
|
| 66 |
st.warning("No components found. Try using different keywords.")
|
|
|
|
| 53 |
if "Products" in data and data["Products"]:
|
| 54 |
st.header("Search Results")
|
| 55 |
|
| 56 |
+
or product in data["Products"]:
|
| 57 |
st.subheader(product["Description"]["ProductDescription"])
|
| 58 |
st.write(f"**Manufacturer**: {product['Manufacturer']['Name']}")
|
| 59 |
st.write(f"**Product Number**: {product['ManufacturerProductNumber']}")
|
| 60 |
st.write(f"**Unit Price**: ${product['UnitPrice']}")
|
| 61 |
st.write(f"[Datasheet]({product['DatasheetUrl']})")
|
| 62 |
st.write(f"[Product Link]({product['ProductUrl']})")
|
| 63 |
+
|
| 64 |
+
# Check if PhotoUrl exists and is not None
|
| 65 |
+
if product.get("PhotoUrl"):
|
| 66 |
+
st.image(product["PhotoUrl"], width=200)
|
| 67 |
+
else:
|
| 68 |
+
st.write("_Image not available_")
|
| 69 |
st.write("---")
|
| 70 |
else:
|
| 71 |
st.warning("No components found. Try using different keywords.")
|