Decided to go with the socket.io-client library, comes with everything we need and react-use-websocket is not tested on the latest version of socket.io
Slightly changed some of the components
redefined MessageProps to match with our messages table on the backend
renamed the original Chat.tsx to PreviousMessages.tsx, removed the dummy data - this now works with any realtime message and should work with messages we pull from Supabase
Updated ChatInput to accept ChatInputProps - these contain function handlers for onSubmit and onChange, as well as the default value for the input box. TODO: add 'placeholder' field so the input placeholder can be dynamic
Renamed the navigation bar components to match with other components
Renamed socket.tsx to Chat.tsx
Will need to add a .env variable NEXT_PUBLIC_SOCKET_URL for this to build
General channel websocket functionality:
messages
table on the backendChat.tsx
toPreviousMessages.tsx
, removed the dummy data - this now works with any realtime message and should work with messages we pull from Supabasesocket.tsx
toChat.tsx
NEXT_PUBLIC_SOCKET_URL
for this to build