setSelectedProduct(suggestion)}
onClick={() =>
setSelectedProduct(
- selectedProduct === suggestion ? null : suggestion
+ selectedProduct.includes(suggestion)
+ ? selectedProduct.filter((item) => item != suggestion)
+ : [...selectedProduct, suggestion]
)
}
>
@@ -43,13 +45,19 @@ const ProductSuggestion = ({ suggestions, selected }) => {
{/* {suggestion.selected && (
انتخاب شما
)} */}
- {selectedProduct === suggestion && (
+ {selectedProduct.includes(suggestion) && (
انتخاب شما
)}
setSelectedProduct(suggestion)}
+ checked={selectedProduct.includes(suggestion)}
+ onClick={() =>
+ setSelectedProduct(
+ selectedProduct.includes(suggestion)
+ ? selectedProduct.filter((item) => item != suggestion)
+ : [...selectedProduct, suggestion]
+ )
+ }
className="checkbox-input mt-4 cursor-pointer w-4 h-4"
type="checkbox"
/>
diff --git a/src/components/RoomCardInfo/images/flower.svg b/src/components/RoomCardInfo/images/flower.svg
new file mode 100644
index 0000000..58bbe1b
--- /dev/null
+++ b/src/components/RoomCardInfo/images/flower.svg
@@ -0,0 +1,87 @@
+
diff --git a/src/components/RoomCardInfo/images/flower2.svg b/src/components/RoomCardInfo/images/flower2.svg
new file mode 100644
index 0000000..5818779
--- /dev/null
+++ b/src/components/RoomCardInfo/images/flower2.svg
@@ -0,0 +1,87 @@
+
diff --git a/src/components/RoomCardInfo/images/qr-code.svg b/src/components/RoomCardInfo/images/qr-code.svg
new file mode 100644
index 0000000..446fb6a
--- /dev/null
+++ b/src/components/RoomCardInfo/images/qr-code.svg
@@ -0,0 +1,8 @@
+
diff --git a/src/components/RoomCardInfo/index.js b/src/components/RoomCardInfo/index.js
new file mode 100644
index 0000000..aec1954
--- /dev/null
+++ b/src/components/RoomCardInfo/index.js
@@ -0,0 +1,34 @@
+import React from "react";
+
+import qrCode from "./images/qr-code.svg";
+import flower2 from "./images/flower2.svg";
+
+const RoomCardInfo = ({ items }) => {
+ return (
+
+ {items.map((item, index) => (
+
+ ))}
+
+
+ );
+};
+
+export default RoomCardInfo;
+
+RoomCardInfo.defaultProps = {
+ items: [
+ {
+ name: "کامران هوشمند",
+ subItems: [
+ {
+ enterData: "1400/11/13",
+ expireData: "1400/11/20",
+ roomNumber: "B14 سالن شهید عباسی",
+ },
+ ],
+ },
+ ],
+};