import * as React from 'react' import classNames from 'classnames' import { highlightTextColors } from '../../colors' import { Text, types } from 'react-bricks/frontend' import blockNames from '../../blockNames' import { badgeColorsEditProps } from '../../LayoutSideProps' export interface BadgeProps { badgeColor: { color: string; className: string } textAlign: 'left' | 'center' className?: string badgeText: types.TextValue } const Badge: types.Brick = ({ badgeColor, textAlign, className, badgeText, }) => { return (
( {props.children} )} placeholder="Badge..." propName="text" value={badgeText} />
) } Badge.schema = { name: blockNames.Badge, label: 'Badge', category: 'shared', hideFromAddMenu: true, playgroundLinkLabel: 'View source code on Github', playgroundLinkUrl: 'https://github.com/ReactBricks/reactbricks-starters/blob/main/packages/reactbricks-ui/nextjs-pages/src/shared/bricks/Badge.tsx', getDefaultProps: () => ({ text: 'Special', textAlign: 'center', badgeColor: highlightTextColors.SKY.value, }), sideEditProps: [badgeColorsEditProps], } export default Badge