// @flow
import React, {Component} from "react";
import {commitWeight, userWeightForPath} from "./commitUtils";
import type {CommitData, FileTree} from "./commitUtils";
export class UserExplorer extends Component<{
selectedPath: string,
selectedUser: ?string,
onSelectUser: (newUser: string) => void,
data: CommitData,
}> {
render() {
const weights = userWeightForPath(
this.props.selectedPath,
this.props.data,
commitWeight
);
const sortedUserWeightTuples = Object.keys(weights)
.map((k) => [k, weights[k]])
.sort((a, b) => b[1] - a[1]);
const entries = sortedUserWeightTuples.map((authorWeight) => {
const [author, weight] = authorWeight;
return