import { ListItem, ListItemText, ListItemAvatar, Avatar, Typography } from '@mui/material'; import React, { MutableRefObject } from 'react'; import { formatters } from './format.js'; export interface EventItemProps { // eslint-disable-next-line @typescript-eslint/no-explicit-any event: any; // eslint-disable-next-line @typescript-eslint/no-explicit-any focusRef?: MutableRefObject; } export function ActionItem(props: EventItemProps) { const { event } = props; const { actor, room, type } = event; const content = formatters[type](event); return {actor} {content} } /> ; } export function WorldItem(props: EventItemProps) { const { event } = props; const { step, world } = event; const { theme } = world; return Step {step} } /> ; } export function MessageItem(props: EventItemProps) { const { event } = props; const { message } = event; return {message} } /> ; } export function PlayerItem(props: EventItemProps) { const { event } = props; const { character, event: innerEvent, id } = event; let primary = ''; let secondary = ''; if (innerEvent === 'join') { primary = 'New Player'; secondary = `${id} is now playing as ${character}`; } if (innerEvent === 'leave') { primary = 'Player Left'; secondary = `${id} has left the game. ${character} is now controlled by an LLM`; } return {secondary} } /> ; } export function EventItem(props: EventItemProps) { const { event } = props; const { type } = event; switch (type) { case 'action': case 'result': return ; case 'event': return ; case 'player': return ; case 'world': return ; default: return ; } }