+ {virtualizer.getVirtualItems().map((virtualRow) => {
+ const row = visibleRows[virtualRow.index];
+ if (row.kind === "node" && row.node == null) {
+ return null;
+ }
+ const selected = row.id === selectedId;
+ return (
+
row.kind === "node" && commitSelection(row.id)}
+ onDoubleClick={() => {
+ if (row.kind !== "node") {
+ return;
+ }
+ if (row.isDirectory) {
+ toggleExpand(row.id);
+ return;
+ }
+ if (row.node != null) {
+ onOpenFile?.(row.id, row.node);
+ }
+ }}
+ >
+
+ {row.kind === "node" && row.isDirectory && row.hasChildren ? (
+
+ ) : (
+
+ )}
+
+ {row.kind === "node" ? (
+ <>
+
+
+ {row.label}
+
+ >
+ ) : (
+
{row.label}
+ )}
+