---
import Tag from './Tag.astro'

interface Props {
  label?: string
  tag?: boolean
}

const { label, tag } = Astro.props

const text: string | undefined = await Astro.slots.render('default')
---

{
  text && text.length > 0 && (
    <p>
      {label && <b>{label}: </b>}
      {tag ? (
        <Tag>
          <Fragment set:html={text} />
        </Tag>
      ) : (
        <Fragment set:html={text} />
      )}
    </p>
  )
}
