11import React , { useEffect , useState } from "react" ;
2- import data from "../components/groups/data/data.json" ;
32import Groups from "../components/groups/Groups" ;
43import Messaging from "../components/groups/Messaging/Messaging" ;
5- import PiggyBank from "../components/groups/PiggyBank" ;
6- import Wishlist from "../components/groups/Wishlist" ;
74import Button from "../components/utils/Button" ;
85import type { GetAllMyGroupsQuery } from "../generated/graphql-types" ;
96import { useGetAllMyGroupsQuery } from "../generated/graphql-types" ;
@@ -13,14 +10,10 @@ export default function Conversations() {
1310 const [ _whislist , setWishlist ] = React . useState ( true ) ;
1411
1512 const { data : groupData } = useGetAllMyGroupsQuery ( ) ;
16- const [ groups , setGroups ] = useState < GetAllMyGroupsQuery [ "getAllMyGroups" ] > (
17- [ ]
18- ) ;
13+ const [ groups , setGroups ] = useState < GetAllMyGroupsQuery [ "getAllMyGroups" ] > ( [ ] ) ;
1914
2015 const [ activeGroupId , setActiveGroupId ] = React . useState < Number | null > ( null ) ;
21- const [ activeGroup , setActiveGroup ] = React . useState <
22- GetAllMyGroupsQuery [ "getAllMyGroups" ] [ 0 ] | null
23- > ( null ) ;
16+ const [ activeGroup , setActiveGroup ] = React . useState < GetAllMyGroupsQuery [ "getAllMyGroups" ] [ 0 ] | null > ( null ) ;
2417
2518 useEffect ( ( ) => {
2619 setGroups ( groupData ?. getAllMyGroups || [ ] ) ;
@@ -41,9 +34,7 @@ export default function Conversations() {
4134 { /* Left Column */ }
4235 < div className = "flex flex-col mx-[2vw] h-full min-h-0 justify-between" >
4336 < div className = "h-[calc(50%-2rem)] flex pb-2 " >
44- { groups && (
45- < Groups groups = { groups } setActiveGroup = { setActiveGroupId } />
46- ) }
37+ { groups && < Groups groups = { groups } setActiveGroup = { setActiveGroupId } /> }
4738 </ div >
4839
4940 < div className = "flex flex-row gap-2 pb-2 absolute top-[calc(50%)]" >
0 commit comments