@@ -12,37 +12,45 @@ let make_table = (matches, dispatch) => {
1212 <Button class_= [ "btn" , "my-2" ] color= ` Danger outline= true on_click= clear>
1313 {"Clear results" |> React . string}
1414 </Button >
15- <table className= "table table-hover" >
16- <thead >
17- <tr >
18- <th scope= "col" > {"#" |> React . string} </th >
19- <th scope= "col" > {"Name" |> React . string} </th >
20- <th scope= "col" > {"Signature" |> React . string} </th >
21- <th scope= "col" > {"Location" |> React . string} </th >
22- </tr >
23- </thead >
24- <tbody >
25- {matches
26- |> List . mapi((i, m) => {
27- let (name , loc , signature , _ ) = m;
28- let key = string_of_int(i);
29- <tr key>
30- <th scope= "row" > {key |> React . string} </th >
31- <td > {name |> React . string} </td >
32- <td > {signature |> React . string} </td >
33- <td >
34- <Link on_click= {on_click(loc)}>
35- {loc. file
36- ++ ":"
37- ++ string_of_int(loc. line)
38- |> React . string}
39- </Link >
40- </td >
41- </tr >;
42- })
43- |> React . list}
44- </tbody >
45- </table >
15+ <CollapsibleList collapsed= false >
16+ {matches
17+ |> List . mapi((i, m) => {
18+ let (name , loc , signature , _ ) = m;
19+ let key = string_of_int(i);
20+ <CollapsibleListItem key= key name= key>
21+ <table className= "table table-hover" >
22+ <thead >
23+ <tr >
24+ <th scope= "col" ></th >
25+ </tr >
26+ </thead >
27+ <tbody >
28+ <tr >
29+ <th scope= "row" > {"Name" |> React . string} </th >
30+ <td > {name |> React . string} </td >
31+ </tr >
32+ <tr >
33+ <th scope= "row" > {"Signature" |> React . string} </th >
34+ <td > {signature |> React . string} </td >
35+ </tr >
36+ <tr >
37+ <th scope= "row" > {"Location" |> React . string} </th >
38+ <td >
39+ <Link on_click= {on_click(loc)}>
40+ {loc. file
41+ ++ ":"
42+ ++ string_of_int(loc. line)
43+ |> React . string}
44+ </Link >
45+ </td >
46+ </tr >
47+ </tbody >
48+ </table >
49+ </CollapsibleListItem >
50+ })
51+ |> React . list
52+ }
53+ </CollapsibleList >
4654 </>;
4755};
4856
@@ -63,7 +71,6 @@ let make = (~matches: Search.matches, ~dispatch) => {
6371 };
6472
6573 <>
66- <h5 className= "card-title" > {"Results" |> React . string} </h5 >
6774 {switch (matches) {
6875 | Loading =>
6976 <div className= "d-flex justify-content-center" >
0 commit comments