import { Avatar, Divider, Image, Row, Space, Tag, Typography } from 'antd'; import React from 'react'; import { Link } from 'react-router-dom'; import styled from 'styled-components'; import { EntityType, GlobalTags } from '../../types.generated'; import { useEntityRegistry } from '../useEntityRegistry'; import CustomAvatar from '../shared/avatar/CustomAvatar'; import TagGroup from '../shared/tags/TagGroup'; interface Props { name: string; logoUrl?: string; url: string; description: string; type?: string; platform?: string; qualifier?: string | null; tags?: GlobalTags; owners?: Array<{ urn: string; name?: string; photoUrl?: string }>; snippet?: React.ReactNode; } 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, url, description, type, platform, qualifier, tags, owners, snippet, }: Props) { const entityRegistry = useEntityRegistry(); return ( {logoUrl && } {name} } size={16}> {type} {platform} {qualifier && {qualifier}}
{description.length === 0 ? ( No description ) : ( {description} )} {snippet}
{owners && owners.length > 0 ? 'Owned By' : ''} {owners?.map((owner) => ( ))}
); }