|
@@ -0,0 +1,34 @@
|
|
1
|
+import {
|
|
2
|
+ IonAccordion,
|
|
3
|
+ IonAccordionGroup,
|
|
4
|
+ IonItem,
|
|
5
|
+ IonLabel,
|
|
6
|
+} from "@ionic/react";
|
|
7
|
+import ListComponent from "../components/ListComponent";
|
|
8
|
+import { Category } from "../types";
|
|
9
|
+import "./DropdownComponent.css";
|
|
10
|
+
|
|
11
|
+const DropdownComponent: React.FC<{
|
|
12
|
+ category: Category[];
|
|
13
|
+}> = (props) => {
|
|
14
|
+ const category = props.category;
|
|
15
|
+ return (
|
|
16
|
+ <IonAccordionGroup>
|
|
17
|
+ {category.map((catItem: Category, index) => {
|
|
18
|
+ return (
|
|
19
|
+ <IonAccordion value={`${index}`}>
|
|
20
|
+ <IonItem slot="header" color="light">
|
|
21
|
+ <IonLabel>{catItem.name}</IonLabel>
|
|
22
|
+ </IonItem>
|
|
23
|
+ <IonItem slot="content">
|
|
24
|
+ <div className="accordion-list-container">
|
|
25
|
+ <ListComponent items={catItem.listItems} />
|
|
26
|
+ </div>
|
|
27
|
+ </IonItem>
|
|
28
|
+ </IonAccordion>
|
|
29
|
+ );
|
|
30
|
+ })}
|
|
31
|
+ </IonAccordionGroup>
|
|
32
|
+ );
|
|
33
|
+};
|
|
34
|
+export default DropdownComponent;
|