fix
This commit is contained in:
@@ -5,13 +5,11 @@ import BuyDropdown from "./BuyDropdown.astro";
|
||||
import Trends from "~/components/Trends.astro";
|
||||
import Search from "~/components/Search.astro";
|
||||
|
||||
import { getCollection } from "astro:content";
|
||||
const courses = await getCollection(
|
||||
"courses",
|
||||
({ data }) => data.draft != true,
|
||||
);
|
||||
|
||||
const { title } = Astro.props;
|
||||
import { getEntries } from "astro:content";
|
||||
const { title, ...data } = Astro.props;
|
||||
const relatedCourses = data?.relatedCourses
|
||||
? await getEntries(data.relatedCourses)
|
||||
: null;
|
||||
---
|
||||
|
||||
<nav class="sticky bg-lime-400 top-0 z-10 drop-shadow shadow-sm">
|
||||
@@ -49,11 +47,28 @@ const { title } = Astro.props;
|
||||
|
||||
<div class="space-y-1.5">
|
||||
<h2 class="font-bold text-xl flex gap-1">
|
||||
<Icon name="arrow-trending-up" class="size-6" />
|
||||
<span>Cursos mais procurados</span>
|
||||
{
|
||||
relatedCourses ? (
|
||||
<>
|
||||
<Icon
|
||||
name="puzzle-piece"
|
||||
class="size-6"
|
||||
/>
|
||||
<span>Cursos relacionados</span>
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<Icon
|
||||
name="arrow-trending-up"
|
||||
class="size-6"
|
||||
/>
|
||||
<span>Cursos mais procurados</span>
|
||||
</>
|
||||
)
|
||||
}
|
||||
</h2>
|
||||
|
||||
<Trends />
|
||||
<Trends relatedCourses={relatedCourses} />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user