## Before  ## After <img width="1056" alt="image" src="https://github.com/user-attachments/assets/4a51b7c7-898b-485f-95e8-97911292f2b1" /> <img width="1299" alt="image" src="https://github.com/user-attachments/assets/44e5e545-a660-455a-91be-3b139ccb9f30" /> <img width="1180" alt="image" src="https://github.com/user-attachments/assets/0ca765a7-1d9a-473a-b7d2-c6f9b1a72417" /> <img width="963" alt="image" src="https://github.com/user-attachments/assets/b620fd8a-61c9-4dd3-a3b1-e4ba940371e4" /> <img width="863" alt="image" src="https://github.com/user-attachments/assets/a0d2dcb5-19e5-4f83-80d4-ad5a715f1e5f" /> --------- Co-authored-by: Charles Bochet <charlesBochet@users.noreply.github.com>
49 lines
1.1 KiB
TypeScript
49 lines
1.1 KiB
TypeScript
import { IconComponent } from 'twenty-ui/display';
|
|
import React from 'react';
|
|
import styled from '@emotion/styled';
|
|
import { useTheme } from '@emotion/react';
|
|
|
|
type SubscriptionInfoRowContainerProps = {
|
|
Icon: IconComponent;
|
|
label: string;
|
|
value: React.ReactNode;
|
|
};
|
|
|
|
const StyledContainer = styled.div`
|
|
align-items: center;
|
|
gap: ${({ theme }) => theme.spacing(1)};
|
|
color: ${({ theme }) => theme.font.color.primary};
|
|
display: flex;
|
|
`;
|
|
|
|
const StyledIconLabelContainer = styled.div`
|
|
align-items: center;
|
|
gap: ${({ theme }) => theme.spacing(1)};
|
|
color: ${({ theme }) => theme.font.color.tertiary};
|
|
display: flex;
|
|
width: 120px;
|
|
`;
|
|
|
|
const StyledLabelContainer = styled.div`
|
|
text-overflow: ellipsis;
|
|
overflow: hidden;
|
|
white-space: nowrap;
|
|
`;
|
|
|
|
export const SubscriptionInfoRowContainer = ({
|
|
Icon,
|
|
label,
|
|
value,
|
|
}: SubscriptionInfoRowContainerProps) => {
|
|
const theme = useTheme();
|
|
return (
|
|
<StyledContainer>
|
|
<StyledIconLabelContainer>
|
|
<Icon size={theme.icon.size.md} />
|
|
<StyledLabelContainer>{label}</StyledLabelContainer>
|
|
</StyledIconLabelContainer>
|
|
{value}
|
|
</StyledContainer>
|
|
);
|
|
};
|