auto-claude: subtask-1-12 - Extract SoftwareAppJsonLd component

This commit is contained in:
2026-01-25 11:18:17 +01:00
parent 52aaa5c80c
commit dc72234434
2 changed files with 67 additions and 2 deletions
+2 -2
View File
@@ -18,8 +18,8 @@
"max": 1
},
"session": {
"number": 1548,
"number": 1556,
"started_at": "2026-01-25T06:23:19.101802"
},
"last_update": "2026-01-25T11:16:43.611638"
"last_update": "2026-01-25T11:18:16.694552"
}
@@ -0,0 +1,65 @@
import { type Locale } from '@/i18n/config';
interface SoftwareAppJsonLdProps {
name: string;
description: string;
applicationCategory: string;
operatingSystem?: string;
offers?: {
price: string;
priceCurrency: string;
};
aggregateRating?: {
ratingValue: string;
ratingCount: string;
};
locale: Locale;
}
export function SoftwareAppJsonLd({
name,
description,
applicationCategory,
operatingSystem = 'Web',
offers,
aggregateRating,
locale,
}: SoftwareAppJsonLdProps) {
const baseUrl = process.env.NEXT_PUBLIC_SITE_URL || 'https://damjan-savic.com';
const schema: Record<string, unknown> = {
'@context': 'https://schema.org',
'@type': 'SoftwareApplication',
name: name,
description: description,
applicationCategory: applicationCategory,
operatingSystem: operatingSystem,
author: {
'@id': `${baseUrl}/#person`,
},
inLanguage: locale === 'de' ? 'de-DE' : locale === 'sr' ? 'sr-RS' : 'en-US',
};
if (offers) {
schema.offers = {
'@type': 'Offer',
price: offers.price,
priceCurrency: offers.priceCurrency,
};
}
if (aggregateRating) {
schema.aggregateRating = {
'@type': 'AggregateRating',
ratingValue: aggregateRating.ratingValue,
ratingCount: aggregateRating.ratingCount,
};
}
return (
<script
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify(schema) }}
/>
);
}