Skip to content

Commit d5ca2cc

Browse files
committed
Fixed a AI code review
Signed-off-by: Moulik Aggarwal <qwertymoulik@gmail.com>
1 parent d69941e commit d5ca2cc

File tree

1 file changed

+13
-42
lines changed

1 file changed

+13
-42
lines changed

apps/docs/src/components/override-components/Footer.astro

Lines changed: 13 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -6,53 +6,24 @@ import { Icon } from "@astrojs/starlight/components";
66
import { markdownify } from "@/lib/utils/textConverter";
77
88
const footer = menu.footer;
9+
const footerSections = [footer.community, footer.help_links, footer.company].filter(Boolean);
910
---
1011

1112
<footer>
1213
<div class="container">
1314
<div class="top-footer">
14-
{
15-
footer.community && (
16-
<div>
17-
<h4>{footer.community.title}</h4>
18-
<ul>
19-
{footer.community?.links.map((link: any) => (
20-
<li>
21-
<a href={link.url}>{link.name}</a>
22-
</li>
23-
))}
24-
</ul>
25-
</div>
26-
)
27-
}
28-
{
29-
footer.help_links && (
30-
<div>
31-
<h4>{footer.help_links.title}</h4>
32-
<ul>
33-
{footer.help_links?.links.map((link: any) => (
34-
<li>
35-
<a href={link.url}>{link.name}</a>
36-
</li>
37-
))}
38-
</ul>
39-
</div>
40-
)
41-
}
42-
{
43-
footer.company && (
44-
<div>
45-
<h4>{footer.company.title}</h4>
46-
<ul>
47-
{footer.company?.links.map((link: any) => (
48-
<li>
49-
<a href={link.url}>{link.name}</a>
50-
</li>
51-
))}
52-
</ul>
53-
</div>
54-
)
55-
}
15+
{footerSections.map((section) => (
16+
<div>
17+
<h4>{section.title}</h4>
18+
<ul>
19+
{section.links.map((link: any) => (
20+
<li>
21+
<a href={link.url}>{link.name}</a>
22+
</li>
23+
))}
24+
</ul>
25+
</div>
26+
))}
5627

5728
{
5829
config?.params?.footer_contact?.enable && (

0 commit comments

Comments
 (0)