This PR was created by [GitStart](https://gitstart.com/) to address the requirements from this ticket: [TWNTY-7532](https://clients.gitstart.com/twenty/5449/tickets/TWNTY-7532). --- ### Description Migrate: - Card - CardContent - CardFooter - CardHeader ### Demo Card in Storybook  ###### Fixes twentyhq/private-issues#86 --------- Co-authored-by: gitstart-twenty <gitstart-twenty@users.noreply.github.com> Co-authored-by: Charles Bochet <charles@twenty.com>
38 lines
904 B
TypeScript
38 lines
904 B
TypeScript
import styled from '@emotion/styled';
|
|
import { ReactNode } from 'react';
|
|
|
|
import { Card, CardContent } from 'twenty-ui';
|
|
|
|
type SettingsSummaryCardProps = {
|
|
title: ReactNode;
|
|
rightComponent: ReactNode;
|
|
};
|
|
|
|
const StyledCardContent = styled(CardContent)`
|
|
align-items: center;
|
|
display: flex;
|
|
gap: ${({ theme }) => theme.spacing(2)};
|
|
padding: ${({ theme }) => theme.spacing(2)};
|
|
min-height: ${({ theme }) => theme.spacing(6)};
|
|
`;
|
|
|
|
const StyledTitle = styled.div`
|
|
color: ${({ theme }) => theme.font.color.primary};
|
|
display: flex;
|
|
font-weight: ${({ theme }) => theme.font.weight.medium};
|
|
gap: ${({ theme }) => theme.spacing(2)};
|
|
margin-right: auto;
|
|
`;
|
|
|
|
export const SettingsSummaryCard = ({
|
|
title,
|
|
rightComponent,
|
|
}: SettingsSummaryCardProps) => (
|
|
<Card>
|
|
<StyledCardContent>
|
|
<StyledTitle>{title}</StyledTitle>
|
|
{rightComponent}
|
|
</StyledCardContent>
|
|
</Card>
|
|
);
|