'use client' import { GroupForm } from '@/components/group-form' import { trpc } from '@/trpc/client' import { useCurrentGroup } from '../current-group-context' export const EditGroup = () => { const { groupId } = useCurrentGroup() const { data, isLoading } = trpc.groups.getDetails.useQuery({ groupId }) const { mutateAsync } = trpc.groups.update.useMutation() const utils = trpc.useUtils() if (isLoading) return <> return ( { await mutateAsync({ groupId, participantId, groupFormValues }) await utils.groups.invalidate() }} protectedParticipantIds={data?.participantsWithExpenses} /> ) }