feat: add search input on user profile pages

This commit is contained in:
2026-06-11 12:39:14 +02:00
parent f10b114e83
commit a95be0b131
4 changed files with 38 additions and 5 deletions

View File

@@ -24,6 +24,8 @@ function ProfilePage() {
view: "trends",
})
const [search, setSearch] = useState("")
if (!auth) return null
if (isPending) return <ProfileSkeleton />
if (!data) return null
@@ -39,6 +41,8 @@ function ProfilePage() {
<ProfileView
data={data}
search={search}
onSearchChange={setSearch}
actions={
<>
<GoalSection goals={data.goals ?? []} />

View File

@@ -1,4 +1,5 @@
import { createFileRoute } from "@tanstack/react-router"
import { useState } from "react"
import { useTranslation } from "react-i18next"
import { UserCheck, UserPlus } from "lucide-react"
import { BackButton } from "@/components/back-button"
@@ -22,6 +23,8 @@ function UserProfilePage() {
const followMutation = useFollow()
const unfollowMutation = useUnfollow()
const [search, setSearch] = useState("")
if (isPending) return <ProfileSkeleton />
if (!data) return null
@@ -35,6 +38,8 @@ function UserProfilePage() {
<ProfileView
data={data}
userId={id}
search={search}
onSearchChange={setSearch}
actions={
data.goals?.length ? (
<div className="space-y-2">