added PermissionRoleRow

This commit is contained in:
Florian Scholdei
2019-05-09 13:46:02 +02:00
parent 1a7b199299
commit 96fcb55c65
2 changed files with 31 additions and 4 deletions

View File

@@ -0,0 +1,26 @@
// @flow
import React from "react";
import { Link } from "react-router-dom";
import type { Role } from "@scm-manager/ui-types";
type Props = {
role: Role
};
class PermissionRoleRow extends React.Component<Props> {
renderLink(to: string, label: string) {
return <Link to={to}>{label}</Link>;
}
render() {
const { role } = this.props;
const to = `./${encodeURIComponent(role.name)}/info`;
return (
<tr>
<td>{this.renderLink(to, role.name)}</td>
</tr>
);
}
}
export default PermissionRoleRow;