Files
mintel.me/apps/web/src/payload/blocks/WebVitalsScoreBlock.ts
Marc Mintel b2f6627ec5
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 6s
Build & Deploy / 🧪 QA (push) Failing after 1m24s
Build & Deploy / 🏗️ Build (push) Has been skipped
Build & Deploy / 🚀 Deploy (push) Has been skipped
Build & Deploy / 🧪 Post-Deploy Verification (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 2s
refactor(payload): extract ai extensions to @mintel/payload-ai package
2026-03-02 23:00:50 +01:00

53 lines
1.3 KiB
TypeScript

import { MintelBlock } from "./types";
import type { Block } from "payload";
export const WebVitalsScoreBlock: MintelBlock = {
slug: "webVitalsScore",
labels: {
singular: "Web Vitals Score",
plural: "Web Vitals Scores",
},
admin: {
group: "MDX Components",
},
ai: {
name: "WebVitalsScore",
description:
"Displays Core Web Vitals (LCP, INP, CLS) in a premium card layout with automatic traffic light coloring (Good/Needs Improvement/Poor). Use for performance audits or comparisons.",
usageExample: "'<WebVitalsScore values={{ lcp: 2.5, inp: 200, cls: 0.1",
},
fields: [
{
name: "lcp",
type: "number",
required: true,
admin: { description: "Largest Contentful Paint (s)" },
},
{
name: "inp",
type: "number",
required: true,
admin: { description: "Interaction to Next Paint (ms)" },
},
{
name: "cls",
type: "number",
required: true,
admin: { description: "Cumulative Layout Shift" },
},
{
name: "description",
type: "text",
admin: {
components: {
afterInput: [
"@mintel/payload-ai/components/AiFieldButton#AiFieldButton",
],
},
description: "Geben Sie den Text für description ein.",
},
},
],
};