fix: correct RSC error patterns and extract skills grouping to utility

This commit is contained in:
Ilia Mashkov
2026-05-05 09:41:49 +03:00
parent 4b18fc454e
commit 4219a7b4e7
3 changed files with 11 additions and 12 deletions
@@ -1,3 +1,4 @@
import { notFound } from 'next/navigation';
import type { PageContentRecord } from '$shared/api';
import { getFirstRecord } from '$shared/api';
@@ -11,7 +12,7 @@ export default async function BioSection() {
});
if (!data) {
return <p>Loading bio content...</p>;
notFound();
}
return (
@@ -1,3 +1,4 @@
import { notFound } from 'next/navigation';
import type { PageContentRecord } from '$shared/api';
import { getFirstRecord } from '$shared/api';
@@ -11,7 +12,7 @@ export default async function IntroSection() {
});
if (!data) {
return <p>Loading intro content...</p>;
notFound();
}
return (
@@ -1,5 +1,7 @@
import { notFound } from 'next/navigation';
import type { SkillRecord } from '$shared/api';
import { getCollection } from '$shared/api';
import { groupByKey } from '$shared/lib';
import { Badge } from '$shared/ui';
/**
@@ -11,16 +13,11 @@ export default async function SkillsSection() {
sort: 'category,order',
});
const categories = data.items.reduce(
(acc, skill) => {
if (!acc[skill.category]) {
acc[skill.category] = [];
}
acc[skill.category].push(skill);
return acc;
},
{} as Record<string, SkillRecord[]>,
);
if (!data.items.length) {
notFound();
}
const categories = groupByKey(data.items, 'category');
return (
<div className="space-y-12">