mirror of
				https://github.com/lingble/twenty.git
				synced 2025-10-31 12:47:58 +00:00 
			
		
		
		
	![gitstart-app[bot]](/assets/img/avatar_default.png) 1dfeba39eb
			
		
	
	1dfeba39eb
	
	
	
		
			
			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>
		
			
				
	
	
		
			34 lines
		
	
	
		
			934 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			34 lines
		
	
	
		
			934 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| import styled from '@emotion/styled';
 | |
| import { ReactNode } from 'react';
 | |
| 
 | |
| import { StyledFormCardTitle } from '@/settings/data-model/fields/components/StyledFormCardTitle';
 | |
| import { Card, CardContent } from 'twenty-ui';
 | |
| 
 | |
| type SettingsDataModelPreviewFormCardProps = {
 | |
|   className?: string;
 | |
|   preview: ReactNode;
 | |
|   form?: ReactNode;
 | |
| };
 | |
| 
 | |
| const StyledPreviewContainer = styled(CardContent)`
 | |
|   background-color: ${({ theme }) => theme.background.transparent.lighter};
 | |
| `;
 | |
| 
 | |
| const StyledFormContainer = styled(CardContent)`
 | |
|   padding: 0;
 | |
| `;
 | |
| 
 | |
| export const SettingsDataModelPreviewFormCard = ({
 | |
|   className,
 | |
|   preview,
 | |
|   form,
 | |
| }: SettingsDataModelPreviewFormCardProps) => (
 | |
|   <Card className={className} fullWidth>
 | |
|     <StyledPreviewContainer divider={!!form}>
 | |
|       <StyledFormCardTitle>Preview</StyledFormCardTitle>
 | |
|       {preview}
 | |
|     </StyledPreviewContainer>
 | |
|     {!!form && <StyledFormContainer>{form}</StyledFormContainer>}
 | |
|   </Card>
 | |
| );
 |