diff --git a/src/app/_components/_sharedcomponents/Chat/Chat.tsx b/src/app/_components/_sharedcomponents/Chat/Chat.tsx index 896f0aa4..d65534bb 100644 --- a/src/app/_components/_sharedcomponents/Chat/Chat.tsx +++ b/src/app/_components/_sharedcomponents/Chat/Chat.tsx @@ -8,7 +8,7 @@ import { Typography, } from '@mui/material'; import { Send } from '@mui/icons-material'; -import { IChatProps, IChatEntry } from './ChatTypes'; +import { IChatProps, IChatEntry, IChatObject } from './ChatTypes'; import { useGame } from '@/app/_contexts/Game.context'; const Chat: React.FC = ({ @@ -31,7 +31,7 @@ const Chat: React.FC = ({ ) } else if (message[0].type === 'playerChat') { - const stringMessage = message.map((item: any) => typeof item === 'object' ? item.name : item).join(''); + const stringMessage = message.map((item: IChatObject | string) => typeof item === 'object' ? item.name : item).join(''); return ( @@ -41,7 +41,7 @@ const Chat: React.FC = ({ ) } - const stringMessage = message.map((item: any) => typeof item === 'object' ? item.name : item).join(''); + const stringMessage = message.map((item: IChatObject | string) => typeof item === 'object' ? item.name : item).join(''); return ( {stringMessage} diff --git a/src/app/_components/_sharedcomponents/Chat/ChatTypes.ts b/src/app/_components/_sharedcomponents/Chat/ChatTypes.ts index e9f1d4e8..3c3a3249 100644 --- a/src/app/_components/_sharedcomponents/Chat/ChatTypes.ts +++ b/src/app/_components/_sharedcomponents/Chat/ChatTypes.ts @@ -1,3 +1,9 @@ +export interface IChatObject { + name: string; + label: string; + uuid: string; +} + export interface IChatMessage { name: string; email: string;