Skip to content

Commit 19ddc80

Browse files
committed
Added Clusters
1 parent 39e430f commit 19ddc80

1 file changed

Lines changed: 49 additions & 7 deletions

File tree

resources/js/Pages/Transmission/ClusterPatternsTab.vue

Lines changed: 49 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<h3 class="text-xl font-semibold text-gray-900">Integration Markers</h3>
2424
<div
2525
class="prose prose-sm max-w-none text-gray-700 leading-relaxed bg-green-50 p-6 rounded-lg border border-green-100"
26-
v-html="formatMarkdown(patterns.integration_markers)"
26+
v-html="formatBoldLabelList(patterns.integration_markers)"
2727
/>
2828
</section>
2929

@@ -117,7 +117,7 @@
117117
<h3 class="text-xl font-semibold text-gray-900">Emerging Meta-Patterns</h3>
118118
<div
119119
class="prose prose-sm max-w-none text-gray-700 leading-relaxed"
120-
v-html="formatMarkdown(patterns.emerging_meta_patterns)"
120+
v-html="formatBoldLabelList(patterns.emerging_meta_patterns)"
121121
/>
122122
</section>
123123

@@ -150,8 +150,8 @@
150150

151151
<script setup>
152152
import { router } from '@inertiajs/vue3'
153-
import markdownit from 'markdown-it'
154153
import SignalCard from './SignalCard.vue'
154+
import markdownit from "markdown-it";
155155
156156
const props = defineProps({
157157
cluster: Object,
@@ -174,14 +174,56 @@ const formatMarkdown = (text) => {
174174
if (!text) return ''
175175
return md.render(text)
176176
}
177+
178+
const formatBoldLabelList = (text) => {
179+
// Split on bold labels followed by colons
180+
const items = text.split(/\*\*([^*]+)\*\*:/).filter(Boolean)
181+
182+
// Group pairs (label, description)
183+
const pairs = []
184+
for (let i = 0; i < items.length; i += 2) {
185+
if (items[i] && items[i + 1]) {
186+
pairs.push({
187+
label: items[i].trim(),
188+
description: items[i + 1].trim()
189+
})
190+
}
191+
}
192+
193+
if (pairs.length === 0) {
194+
return md.render(text, { breaks: true, gfm: true })
195+
}
196+
197+
// Format as HTML list
198+
const listItems = pairs.map(pair =>
199+
`<li><strong>${pair.label}</strong>: ${pair.description}</li>`
200+
).join('')
201+
202+
return `<ul class="space-y-3">${listItems}</ul>`
203+
}
177204
</script>
178205
179206
<style scoped>
180-
.prose :deep(p) {
181-
margin-bottom: 1rem;
207+
:deep(ul) {
208+
list-style: none;
209+
padding-left: 0;
210+
}
211+
212+
:deep(ul li) {
213+
padding-left: 1.5rem;
214+
position: relative;
215+
margin-bottom: 0.75rem;
216+
}
217+
218+
:deep(ul li:before) {
219+
content: "";
220+
position: absolute;
221+
left: 0;
222+
color: #9ca3af;
223+
font-weight: bold;
182224
}
183225
184-
.prose :deep(p + p) {
185-
margin-top: 1rem;
226+
:deep(ul li strong) {
227+
color: #111827;
186228
}
187229
</style>

0 commit comments

Comments
 (0)