saleor-dashboard/src/components/TableCellAvatar/TableCellAvatar.tsx
Karolina Rakoczy f5a8db9f2e
Update data test ids for 3.1 (#1814)
* add update data test ids

* fix not changed test ids

* fix data-test-id for gift cards

* remove comment

* fix base url
2022-02-11 12:28:55 +01:00

42 lines
955 B
TypeScript

import { TableCell } from "@material-ui/core";
import { TableCellProps } from "@material-ui/core/TableCell";
import { makeStyles } from "@saleor/macaw-ui";
import classNames from "classnames";
import React from "react";
import Avatar, { AvatarProps } from "./Avatar";
const useStyles = makeStyles(
theme => ({
root: {
"&:not(first-child)": {
paddingLeft: 0
},
paddingRight: theme.spacing(3),
width: "1%"
}
}),
{ name: "TableCellAvatar" }
);
interface TableCellAvatarProps extends AvatarProps, TableCellProps {
className?: string;
}
const TableCellAvatar: React.FC<TableCellAvatarProps> = props => {
const { className, ...rest } = props;
const classes = useStyles(props);
return (
<TableCell
className={classNames(classes.root, className)}
data-test-id="table-cell-avatar"
{...rest}
>
<Avatar {...rest} />
</TableCell>
);
};
export default TableCellAvatar;