// @flow import React from "react"; import { Link } from "react-router-dom"; import type { Branch } from "@scm-manager/ui-types"; type Props = { baseUrl: string, branch: Branch }; export default class BranchRow extends React.Component { renderLink(to: string, label: string, defaultBranch: boolean) { let showLabel = null; if(defaultBranch) { showLabel = Default; } return {label} {showLabel}; } render() { const { baseUrl, branch } = this.props; const to = `${baseUrl}/${encodeURIComponent(branch.name)}/info`; return ( {this.renderLink(to, branch.name, branch.defaultBranch)} ); } }