feat(18-05): add public profile page and setup visibility toggle

- Create public profile page at /users/$userId with avatar, name, bio, setups
- Create PublicSetupCard component for profile page setup listing
- Add isPublic toggle button on setup detail page
- Add Public badge to SetupCard in list view
- Update useSetups hook with isPublic field on interfaces
This commit is contained in:
2026-04-05 13:19:36 +02:00
parent f120d179f7
commit a9956681ba
6 changed files with 179 additions and 2 deletions

View File

@@ -11,6 +11,7 @@ import {
interface SetupListItem {
id: number;
name: string;
isPublic: boolean;
createdAt: string;
updatedAt: string;
itemCount: number;
@@ -38,6 +39,7 @@ interface SetupItemWithCategory {
interface SetupWithItems {
id: number;
name: string;
isPublic: boolean;
createdAt: string;
updatedAt: string;
items: SetupItemWithCategory[];
@@ -76,7 +78,7 @@ export function useCreateSetup() {
export function useUpdateSetup(setupId: number) {
const queryClient = useQueryClient();
return useMutation({
mutationFn: (data: { name?: string }) =>
mutationFn: (data: { name?: string; isPublic?: boolean }) =>
apiPut<SetupListItem>(`/api/setups/${setupId}`, data),
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: ["setups"] });