@@ -20,6 +20,7 @@ import {
2020import { getFeedByType , getFeedPosts } from "../data/feed"
2121import { getUserById , getAllUsers } from "@/lib/api"
2222import { formatDate , formatNumber } from "@/lib/format"
23+ import type { FeedPost } from "../data/feed"
2324
2425export const dynamic = 'force-dynamic'
2526
@@ -156,7 +157,7 @@ export default async function CommunityPage() {
156157
157158import type { ApiUser } from "@/lib/api"
158159
159- function FeedPost ( { post, users } : { post : ( typeof feedPosts ) [ 0 ] , users : ApiUser [ ] } ) {
160+ function FeedPost ( { post, users } : { post : FeedPost , users : ApiUser [ ] } ) {
160161 const author = users . find ( u => String ( u . id ) === String ( post . authorId ) )
161162
162163 const typeIcons = {
@@ -191,8 +192,8 @@ function FeedPost({ post, users }: { post: (typeof feedPosts)[0], users: ApiUser
191192 < span className = "text-xs sm:text-sm text-muted-foreground hidden sm:inline" > @{ author ?. username } </ span >
192193 < span className = "text-muted-foreground hidden sm:inline" > ·</ span >
193194 < span className = "text-xs sm:text-sm text-muted-foreground" > { formatDate ( post . createdAt ) } </ span >
194- < Badge className = { `${ typeColors [ post . type ] } text-[10px] sm:text-xs shrink-0` } >
195- { typeIcons [ post . type ] }
195+ < Badge className = { `${ typeColors [ post . type as keyof typeof typeColors ] } text-[10px] sm:text-xs shrink-0` } >
196+ { typeIcons [ post . type as keyof typeof typeIcons ] }
196197 < span className = "ml-0.5 sm:ml-1 capitalize" > { post . type } </ span >
197198 </ Badge >
198199 </ div >
@@ -221,7 +222,7 @@ function FeedPost({ post, users }: { post: (typeof feedPosts)[0], users: ApiUser
221222
222223 { post . tags . length > 0 && (
223224 < div className = "flex flex-wrap gap-1 mt-2 sm:mt-3" >
224- { post . tags . map ( ( tag ) => (
225+ { post . tags . map ( ( tag : string ) => (
225226 < Badge key = { tag } variant = "outline" className = "text-[10px] sm:text-xs" >
226227 #{ tag }
227228 </ Badge >
0 commit comments