make seo helper service buttons optional and reuse components v2 script builder for meta on every page
Frontend CI/CD / test-and-build (push) Successful in 25s
Frontend CI/CD / deploy (push) Successful in 26s

This commit is contained in:
itzMiney committed 2026-11-08 01:54:41 +01:00
1 parent 921659a2c2
commit 8976d56495
1 file changed
+16 -13
+16 -13
View File
@@ -54,15 +54,7 @@ export class SeoService {
existingScript.remove(); existingScript.remove();
} }
if (!buttons || buttons.length === 0) return; const sectionComponent = {
const componentPayload = {
flags: 32768,
component: {
type: 17,
accent_color: parseInt(this.siteColor.replace('#', ''), 16),
components: [
{
type: 9, type: 9,
components: [ components: [
{ {
@@ -76,17 +68,28 @@ export class SeoService {
url: 'https://itzminey.dev/assets/thumb.png' url: 'https://itzminey.dev/assets/thumb.png'
} }
} }
}, };
{
type: 1, // Action Row for buttons const containerComponents: any[] = [sectionComponent];
if (buttons && buttons.length > 0) {
containerComponents.push({
type: 1,
components: buttons.map(btn => ({ components: buttons.map(btn => ({
type: 2, type: 2,
label: btn.label, label: btn.label,
style: 5, style: 5,
url: btn.url url: btn.url
})) }))
});
} }
]
const componentPayload = {
flags: 32768,
component: {
type: 17,
accent_color: parseInt(this.siteColor.replace('#', ''), 16),
components: containerComponents
} }
}; };