Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughAdds English and Swedish about-us content describing Malmö's open data initiatives, and integrates a markdown rendering function into the about-us page to dynamically display the localized content. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@src/app/`[locale]/about-us/page.tsx:
- Line 15: The page currently assigns const content = getMarkdownContent(...)
which returns a Promise, so change the page component to be async (e.g., export
default async function Page(...) or add async to the enclosing function) and
await the call: const content = await
getMarkdownContent(`about-us/${locale}.md`); ensure you update any
callers/exports to support an async server component and keep references to
getMarkdownContent and content consistent.
🧹 Nitpick comments (2)
src/app/[locale]/about-us/page.tsx (2)
19-19: Raw markdown is rendered as plain text — no HTML conversion.The content is inserted directly into a
<div>without any markdown-to-HTML processing. Currently the.mdfiles contain only plain paragraphs so this won't cause visible issues, but if any markdown syntax (headings, links, lists, bold, etc.) is added later, it will render as raw text. Consider using a library likereact-markdownor converting to HTML withremark/unifiedbefore rendering.Example using dangerouslySetInnerHTML with a remark pipeline
+import { remark } from "remark"; +import html from "remark-html"; + // inside the component, after awaiting content: - <div>{content}</div> + const processed = await remark().use(html).process(content); + const htmlContent = processed.toString(); + // ... + <div dangerouslySetInnerHTML={{ __html: htmlContent }} />Alternatively, use
react-markdownfor a safer approach withoutdangerouslySetInnerHTML.
12-12: Function is namedSearchPagebut this is the About Us page.Looks like a copy-paste artifact. Consider renaming for clarity.
Proposed fix
-export default async function SearchPage({ params }: Props) { +export default async function AboutUsPage({ params }: Props) {
Issue: https://github.com/datopian/City-of-Malmo-Open-Data-Portal/issues/37
Changes: added content for
enandsvSummary by CodeRabbit