Files
SCM-Manager/scm-ui/src/config/components/table/PermissionRoleRow.js

27 lines
544 B
JavaScript
Raw Normal View History

2019-05-09 13:46:02 +02:00
// @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;