mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-09 23:15:43 +01:00
26 lines
610 B
JavaScript
26 lines
610 B
JavaScript
|
|
// @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<Props> {
|
||
|
|
renderLink(to: string, label: string) {
|
||
|
|
return <Link to={to}>{label} <span className="tag is-dark">Default</span></Link>;
|
||
|
|
}
|
||
|
|
|
||
|
|
render() {
|
||
|
|
const { baseUrl, branch } = this.props;
|
||
|
|
const to = `${baseUrl}/${encodeURIComponent(branch.name)}/info`;
|
||
|
|
return (
|
||
|
|
<tr>
|
||
|
|
<td>{this.renderLink(to, branch.name)}</td>
|
||
|
|
</tr>
|
||
|
|
);
|
||
|
|
}
|
||
|
|
}
|