Skip to content

Open-source social media scheduler built for AI agents and the teams behind them. Create, schedule and publish posts to every network through MCP or the REST API, or write them yourself in a composer your team will love.

1.5 KB
Raw Blame
<script props>
  // https://maizzle.com/docs/components/button
  let align = {
    left: 'text-left',
    center: 'text-center',
    right: 'text-right',
  }[props.align] || 'text-center'

  let variant = props.variant === 'secondary'
    ? 'bg-surface border-border'
    : 'bg-primary border-primary'

  let size = props.size === 'sm'
    ? 'px-4 py-2.5 text-sm leading-5 whitespace-nowrap sm:px-1.5 sm:text-xs'
    : 'px-6 py-3 text-base leading-6'

  let styles = [
    'display: inline-block;',
    'text-decoration: none;',
    'font-weight: 600;',
    'border-radius: 8px;',
  ]

  let hasBgClass = () => props.class && props.class.split(' ').some(c => c.startsWith('bg-'))

  if (props['bg-color'] && !hasBgClass()) {
    styles.push(`background-color: ${props['bg-color']};`)
  }

  if (props.color) {
    styles.push(`color: ${props.color};`)
  }

  module.exports = {
    align,
    variant,
    size,
    href: props.href,
    styles: styles.join(''),
    msoPt: props['mso-pt'] || '16px',
    msoPb: props['mso-pb'] || '31px',
  }
</script>

<div class="{{ align }}">
  <a attributes href="{{ href }}" class="{{ variant }} {{ size }} border border-solid text-foreground text-center" style="{{ styles }}">
    <outlook trim>
      <i class="mso-font-width-[150%]" style="mso-text-raise: {{ msoPb }};" hidden>&emsp;</i>
    </outlook>
    <span style="mso-text-raise: {{ msoPt }}" trim>
      <yield />
    </span>
    <outlook trim>
      <i class="mso-font-width-[150%]" hidden>&emsp;&#8203;</i>
    </outlook>
  </a>
</div>