Files
twenty_crm/front/src/modules/spreadsheet-import/components/Heading.tsx
gitstart-twenty 77a1840611 Chore(front): Create a custom eslint rule for Props naming (#1904)
Co-authored-by: v1b3m <vibenjamin6@gmail.com>
Co-authored-by: Matheus <matheus_benini@hotmail.com>
Co-authored-by: bosiraphael <raphael.bosi@gmail.com>
2023-10-09 16:31:13 +02:00

37 lines
1.1 KiB
TypeScript

import React from 'react';
import styled from '@emotion/styled';
export type HeadingProps = 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 const Heading = ({ title, description, ...props }: HeadingProps) => (
// eslint-disable-next-line twenty/no-spread-props
<StyledContainer {...props}>
<StyledTitle>{title}</StyledTitle>
{description && <StyledDescription>{description}</StyledDescription>}
</StyledContainer>
);