Add icon property to table.

This commit is contained in:
Anders Borch
2023-04-12 13:30:13 +02:00
parent cb3a209380
commit b7e43de670
2 changed files with 18 additions and 4 deletions

View File

@ -1,15 +1,27 @@
import styled from '@emotion/styled';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { IconProp } from '@fortawesome/fontawesome-svg-core';
type OwnProps = {
viewName: string;
viewIcon?: IconProp;
};
const StyledTitle = styled.div`
display: flex;
flex-direction: row;
align-items: center;
gap: 5px;
color: ${(props) => props.theme.text60};
`;
function TableHeader({ viewName }: OwnProps) {
return <StyledTitle>{viewName}</StyledTitle>;
function TableHeader({ viewName, viewIcon }: OwnProps) {
return (
<StyledTitle>
{viewIcon && <FontAwesomeIcon icon={viewIcon} />}
{viewName}
</StyledTitle>
);
}
export default TableHeader;