auto-claude: subtask-1-5 - Extract FAQJsonLd component
This commit is contained in:
+3
-3
@@ -3,7 +3,7 @@
|
||||
"spec": "032-split-large-jsonld-tsx-component-759-lines-into-se",
|
||||
"state": "building",
|
||||
"subtasks": {
|
||||
"completed": 3,
|
||||
"completed": 4,
|
||||
"total": 19,
|
||||
"in_progress": 1,
|
||||
"failed": 0
|
||||
@@ -18,8 +18,8 @@
|
||||
"max": 1
|
||||
},
|
||||
"session": {
|
||||
"number": 5,
|
||||
"number": 6,
|
||||
"started_at": "2026-01-25T06:23:19.101802"
|
||||
},
|
||||
"last_update": "2026-01-25T06:32:33.169444"
|
||||
"last_update": "2026-01-25T06:33:47.759616"
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
import { type Locale } from '@/i18n/config';
|
||||
|
||||
interface FAQItem {
|
||||
question: string;
|
||||
answer: string;
|
||||
}
|
||||
|
||||
export function FAQJsonLd({ items, locale }: { items: FAQItem[]; locale?: Locale }) {
|
||||
const schema = {
|
||||
'@context': 'https://schema.org',
|
||||
'@type': 'FAQPage',
|
||||
inLanguage: locale ? (locale === 'de' ? 'de-DE' : locale === 'sr' ? 'sr-RS' : 'en-US') : 'de-DE',
|
||||
mainEntity: items.map((item) => ({
|
||||
'@type': 'Question',
|
||||
name: item.question,
|
||||
acceptedAnswer: {
|
||||
'@type': 'Answer',
|
||||
text: item.answer,
|
||||
},
|
||||
})),
|
||||
};
|
||||
|
||||
return (
|
||||
<script
|
||||
type="application/ld+json"
|
||||
dangerouslySetInnerHTML={{ __html: JSON.stringify(schema) }}
|
||||
/>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user