<?php
$preset_labels = [
  'mission' => 'Our Mission',
  'team' => 'Our Team',
];

$preset = isset($attributes['preset']) ? (string) $attributes['preset'] : 'mission';
$title = isset($attributes['title']) ? (string) $attributes['title'] : '';

if ($preset !== 'custom') {
  $title = $preset_labels[$preset] ?? 'Our Mission';
}

$styles = [];
$background = isset($attributes['backgroundColor']) ? (string) $attributes['backgroundColor'] : '';
$text_color = isset($attributes['textColor']) ? (string) $attributes['textColor'] : '';

if ($background !== '') {
  $styles[] = 'background:' . $background;
}
if ($text_color !== '') {
  $styles[] = 'color:' . $text_color;
}

$style_attr = $styles ? ' style="' . esc_attr(implode(';', $styles)) . '"' : '';
?>
<div class="fjord-about-pill"<?php echo $style_attr; ?>><?php echo esc_html($title); ?></div>
