//@flow import React from "react"; import type { Repository, Branch } from "@scm-manager/ui-types"; import { translate } from "react-i18next"; import injectSheet from "react-jss"; import classNames from "classnames"; import BranchButtonGroup from "./BranchButtonGroup"; type Props = { repository: Repository, branch: Branch, // context props t: string => string, classes: any }; const styles = { tag: { marginLeft: "0.75rem", verticalAlign: "inherit" } }; class BranchDetailTable extends React.Component { render() { const { repository, branch, t } = this.props; return (
{t("branch.name")} {branch.name} {this.renderDefaultBranch()}
{t("branch.repository")} {repository.name}
{t("branch.actions")}
); } renderDefaultBranch() { const { branch, classes } = this.props; let defaultLabel = null; if (branch.defaultBranch) { defaultLabel = ( Default ); } return defaultLabel; } } export default injectSheet(styles)(translate("repos")(BranchDetailTable));