protected function createMetrics(array $data, ?string $name = null): string
    {
        $html = $name !== null ? '<h3>' . $name . '</h3>' : '';
        $html .= '<ul class="metrics">';

        foreach ($data as $key => $value) {
            $html .= '<li class="metric">';
            $html .= '<span class="value">' . $value . '</span><span class="label">' . $key . '</span>';
            $html .= '</li>';
        }

        $html .= '</ul>';

        return $html;
    }