(props: SidebarProps)
| 58 | } |
| 59 | |
| 60 | export default function Sidebar(props: SidebarProps) { |
| 61 | return ( |
| 62 | <side-bar |
| 63 | style={{ |
| 64 | maxWidth: 250, |
| 65 | minWidth: 200, |
| 66 | }} |
| 67 | > |
| 68 | <scroll-view |
| 69 | disableDefaultDocumentView |
| 70 | style={{ |
| 71 | width: "100%", |
| 72 | height: "100%", |
| 73 | }} |
| 74 | > |
| 75 | <outline |
| 76 | onItemSelected={(event) => { |
| 77 | props.onSelectedItemChange( |
| 78 | event.item.getAttribute("data-item") as unknown as SidebarItem |
| 79 | ); |
| 80 | }} |
| 81 | > |
| 82 | <For each={sidebarItemsData[props.selectedView]}> |
| 83 | {(item, _index) => ( |
| 84 | <table-cell |
| 85 | selected={props.selectedItem?.id === item.id} |
| 86 | data-item={item} |
| 87 | identifier={item.id} |
| 88 | > |
| 89 | <image symbol={item.icon} /> |
| 90 | <text>{item.title}</text> |
| 91 | <For each={item.children}> |
| 92 | {(child, _index) => ( |
| 93 | <table-cell |
| 94 | selected={props.selectedItem?.id === child.id} |
| 95 | identifier={item.id} |
| 96 | data-item={child} |
| 97 | > |
| 98 | <image symbol={child.icon} /> |
| 99 | <text>{child.title}</text> |
| 100 | </table-cell> |
| 101 | )} |
| 102 | </For> |
| 103 | </table-cell> |
| 104 | )} |
| 105 | </For> |
| 106 | </outline> |
| 107 | </scroll-view> |
| 108 | </side-bar> |
| 109 | ); |
| 110 | } |
nothing calls this directly
no outgoing calls
no test coverage detected