feat: wire public posts api

This commit is contained in:
TerryM
2026-05-26 12:07:13 +08:00
parent f482a2ec38
commit d3c30795dc
19 changed files with 299 additions and 163 deletions

View File

@@ -16,12 +16,8 @@ export function MessageStream({ scope }: MessageStreamProps) {
const [sp, setSp] = useSearchParams();
const type = sp.get("type") || "all";
const language = sp.get("language") || "";
const params = useMemo(
() => ({ scope, type, language, lang }),
[scope, type, language, lang],
);
const params = useMemo(() => ({ scope, type, lang }), [scope, type, lang]);
const { items, isLoading, error, hasMore, loadMore, reset } =
usePostStream(params);
@@ -68,12 +64,7 @@ export function MessageStream({ scope }: MessageStreamProps) {
return (
<div className="mx-auto max-w-full px-3 md:max-w-[820px] lg:max-w-[1080px] xl:max-w-[1180px]">
<FilterChips
type={type}
language={language}
onTypeChange={(v) => updateParam("type", v)}
onLanguageChange={(v) => updateParam("language", v)}
/>
<FilterChips type={type} onTypeChange={(v) => updateParam("type", v)} />
<div className="flex flex-col gap-2 pb-10 pt-2">
{groups.map((group) => (