refactor: create company chip

This commit is contained in:
Sammy Teillet
2023-04-19 12:03:02 +02:00
parent bb40c1b40a
commit 471d6743ad
4 changed files with 94 additions and 25 deletions

View File

@ -1,6 +1,6 @@
import * as React from 'react';
import styled from '@emotion/styled';
import { Link } from 'react-router-dom';
import CompanyChip from '../chips/CompanyChip';
type OwnProps = {
name: string;
@ -8,33 +8,10 @@ type OwnProps = {
href: string;
};
const StyledContainer = styled.span`
background-color: ${(props) => props.theme.tertiaryBackground};
border-radius: ${(props) => props.theme.spacing(1)};
color: ${(props) => props.theme.text80};
display: inline-flex;
align-items: center;
padding: ${(props) => props.theme.spacing(1)};
gap: ${(props) => props.theme.spacing(1)};
:hover {
filter: brightness(95%);
}
img {
height: 14px;
width: 14px;
object-fit: cover;
}
`;
function CellLink({ name, picture, href }: OwnProps) {
return (
<Link to={href}>
<StyledContainer>
{picture && <img src={picture?.toString()} alt="" />}
{name}
</StyledContainer>
<CompanyChip name={name} picture={picture} />
</Link>
);
}