Files
twenty/front/src/modules/spreadsheet-import/components/Heading.tsx
Weiko 9b34a0ff3d Add styled component rule (#1261)
* Add StyledComponent rule

* update doc

* update doc

* update doc
2023-08-17 20:58:02 -07:00

38 lines
1.0 KiB
TypeScript

import React from 'react';
import styled from '@emotion/styled';
export type Props = React.ComponentProps<'div'> & {
title: string;
description?: string;
};
const StyledContainer = styled.div`
align-items: center;
display: flex;
flex-direction: column;
`;
const StyledTitle = styled.span`
color: ${({ theme }) => theme.font.color.primary};
font-size: ${({ theme }) => theme.font.size.lg};
font-weight: ${({ theme }) => theme.font.weight.semiBold};
text-align: center;
`;
const StyledDescription = styled.span`
color: ${({ theme }) => theme.font.color.primary};
font-size: ${({ theme }) => theme.font.size.sm};
font-weight: ${({ theme }) => theme.font.weight.regular};
margin-top: ${({ theme }) => theme.spacing(3)};
text-align: center;
`;
export function Heading({ title, description, ...props }: Props) {
return (
<StyledContainer {...props}>
<StyledTitle>{title}</StyledTitle>
{description && <StyledDescription>{description}</StyledDescription>}
</StyledContainer>
);
}