import classNames from 'classnames' import React from 'react' import { Text, Image, Link, types } from 'react-bricks/rsc' import blockNames from '../../blockNames' import { textColors } from '../../colors' import { icons } from '../../shared/defaultImages' interface LinkCardProps { withIcon: boolean withTitle: boolean withLink: boolean linkPath: string icon: types.IImageSource title: types.TextValue text: types.TextValue } const LinkCard: types.Brick = ({ withIcon, withTitle, linkPath, icon, title, text, }) => { return (
{withIcon && ( logo )}
{withTitle && ( (
{props.children}
)} placeholder="Title..." /> )}
{props.children}
} placeholder="Text..." />
) } LinkCard.schema = { name: blockNames.LinkCard, label: 'Card', category: 'main content', hideFromAddMenu: true, playgroundLinkLabel: 'View source code on Github', playgroundLinkUrl: 'https://github.com/ReactBricks/reactbricks-starters/blob/main/packages/reactbricks-ui/nextjs-app/src/mainContent/LinkCards/LinkCard.tsx', getDefaultProps: () => ({ withIcon: true, withTitle: true, icon: icons.PHOTO_STACK, title: 'Visual editing', text: 'The best UX on the market, no training required.', linkPath: '/', }), sideEditProps: [ { name: 'withIcon', label: 'With Icon', type: types.SideEditPropType.Boolean, }, { name: 'withTitle', label: 'With Title', type: types.SideEditPropType.Boolean, }, { name: 'linkPath', label: 'Link to', type: types.SideEditPropType.Text, }, ], } export default LinkCard