import * as React from 'react' import classNames from 'classnames' import { highlightTextColors } from '../../colors' import { Text, types } from 'react-bricks/rsc' import blockNames from '../../blockNames' import { badgeColorsEditProps } from '../../LayoutSideProps' export interface BadgeProps { badgeColor: { color: string; className: string } textAlign: 'left' | 'center' className?: string text: types.TextValue } const Badge: types.Brick = ({ badgeColor, textAlign, className, text, }) => { return (
( {props.children} )} placeholder="Badge..." />
) } 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-app/src/shared/bricks/Badge.tsx', getDefaultProps: () => ({ text: 'Special', textAlign: 'center', badgeColor: highlightTextColors.SKY.value, }), sideEditProps: [badgeColorsEditProps], } export default Badge