fleet/frontend/components/TableContainer/DataTable/LinkCell/LinkCell.tsx
RachelElysia 5e40afa8ba
Clean up linter warnings (#1026)
* Fix 25+ linter warnings
Co-authored by: Sarah Gillespie @gillespi314
2021-06-10 10:00:03 -04:00

29 lines
596 B
TypeScript

import React from "react";
import { useDispatch } from "react-redux";
import { push } from "react-router-redux";
import Button from "components/buttons/Button/Button";
interface ILinkCellProps<T> {
value: string;
path: string;
title?: string;
}
const LinkCell = (props: ILinkCellProps<any>): JSX.Element => {
const { value, path, title } = props;
const dispatch = useDispatch();
const onClick = (): void => {
dispatch(push(path));
};
return (
<Button onClick={onClick} variant="text-link" title={title}>
{value}
</Button>
);
};
export default LinkCell;