Move distinct components to individual files
This commit is contained in:
parent
97f703f7d7
commit
834e36b5a3
6 changed files with 157 additions and 98 deletions
17
src/apps/experimental/components/GridActionsCellLink.tsx
Normal file
17
src/apps/experimental/components/GridActionsCellLink.tsx
Normal file
|
@ -0,0 +1,17 @@
|
|||
import React, { type RefAttributes } from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { GridActionsCellItem, type GridActionsCellItemProps } from '@mui/x-data-grid';
|
||||
|
||||
type GridActionsCellLinkProps = { to: string } & GridActionsCellItemProps & RefAttributes<HTMLButtonElement>;
|
||||
|
||||
/**
|
||||
* Link component to use in mui's data-grid action column due to a current bug with passing props to custom link components.
|
||||
* @see https://github.com/mui/mui-x/issues/4654
|
||||
*/
|
||||
const GridActionsCellLink = ({ to, ...props }: GridActionsCellLinkProps) => (
|
||||
<Link to={to}>
|
||||
<GridActionsCellItem {...props} />
|
||||
</Link>
|
||||
);
|
||||
|
||||
export default GridActionsCellLink;
|
Loading…
Add table
Add a link
Reference in a new issue