diff --git a/components/OrganizedContent.tsx b/components/OrganizedContent.tsx index 6d18db4c..50cadad4 100644 --- a/components/OrganizedContent.tsx +++ b/components/OrganizedContent.tsx @@ -13,7 +13,6 @@ type Link = ComponentType; interface Section { id: string; title: string; - Content: ComponentType; } const READ_ALL_TITLE = "Read All"; @@ -21,16 +20,23 @@ export const READ_ALL_ID = "read-all"; interface Props { sections: Section[]; - currentId: string; + id: string; + children: ReactNode; link: Link; } -export function OrganizedContent(props: Props) { - const sections = createSections(props.sections); - const currentIndex = sections.findIndex(({ id }) => id === props.currentId); +export function OrganizedContent({ + sections, + id, + children, + link: Link, +}: Props) { + const currentIndex = sections.findIndex( + ({ id: sectionId }) => sectionId === id + ); if (currentIndex < 0) { - throw new Error(`Section with ID ${props.currentId} was not found`); + throw new Error(`Section with ID ${id} was not found`); } const section = sections[currentIndex]; @@ -38,20 +44,20 @@ export function OrganizedContent(props: Props) { return (
-