import { Divider, Image, Row, Space, Tag, Typography } from 'antd'; import React from 'react'; import { Link } from 'react-router-dom'; import styled from 'styled-components'; import { GlobalTags, Owner, GlossaryTerms } from '../../types.generated'; import { useEntityRegistry } from '../useEntityRegistry'; import AvatarsGroup from '../shared/avatar/AvatarsGroup'; import TagTermGroup from '../shared/tags/TagTermGroup'; interface Props { name: string; logoUrl?: string; logoComponent?: JSX.Element; url: string; description: string; type?: string; platform?: string; qualifier?: string | null; tags?: GlobalTags; owners?: Array | null; snippet?: React.ReactNode; glossaryTerms?: GlossaryTerms; dataTestID?: string; } const DescriptionParagraph = styled(Typography.Paragraph)` &&& { margin-bottom: 0px; padding-left: 8px; } `; const PreviewImage = styled(Image)` max-height: 48px; width: auto; object-fit: contain; `; const styles = { row: { width: '100%', marginBottom: '0px' }, leftColumn: { maxWidth: '75%' }, rightColumn: { maxWidth: '25%' }, name: { fontSize: '18px' }, typeName: { color: '#585858' }, platformName: { color: '#585858' }, ownedBy: { color: '#585858' }, }; export default function DefaultPreviewCard({ name, logoUrl, logoComponent, url, description, type, platform, qualifier, tags, owners, snippet, glossaryTerms, dataTestID, }: Props) { const entityRegistry = useEntityRegistry(); return ( {logoUrl ? : logoComponent || ''} {name} {(type || platform || qualifier) && ( } size={16}> {type} {platform} {qualifier && {qualifier}} )}
{description.length === 0 ? ( No description ) : ( {description} )} {snippet}
{owners && owners.length > 0 ? 'Owned By' : ''}
); }