perf improvements

This commit is contained in:
Michael Freno
2026-01-04 14:53:30 -05:00
parent 111712e969
commit a620a9f4c5
10 changed files with 303 additions and 1750 deletions

View File

@@ -1,6 +1,6 @@
import { For, Show, createMemo } from "solid-js";
import Card from "./Card";
import { Post } from "~/db/types";
import { PostCardData } from "~/db/types";
export interface Tag {
value: string;
@@ -8,7 +8,7 @@ export interface Tag {
}
export interface PostSortingProps {
posts: Post[];
posts: PostCardData[];
tags: Tag[];
privilegeLevel: "anonymous" | "admin" | "user";
filters?: string;
@@ -133,9 +133,13 @@ export default function PostSorting(props: PostSortingProps) {
}
>
<For each={sortedPosts()}>
{(post) => (
{(post, index) => (
<div class="my-4">
<Card post={post} privilegeLevel={props.privilegeLevel} />
<Card
post={post}
privilegeLevel={props.privilegeLevel}
index={index()}
/>
</div>
)}
</For>