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 ActionEventItem(props: EventItemProps) { const { event } = props; const { actor, room, type } = event; const content = formatters[type](event); return {actor.name} {content} } /> ; } export function SnapshotEventItem(props: EventItemProps) { const { event } = props; const { step, world } = event; const { theme } = world; return Step {step} } /> ; } export function ReplyEventItem(props: EventItemProps) { const { event } = props; const { text } = event; return {text} } /> ; } export function PlayerEventItem(props: EventItemProps) { const { event } = props; const { character, status, client } = event; let primary = ''; let secondary = ''; if (status === 'join') { primary = 'New Player'; secondary = `${client} is now playing as ${character}`; } if (status === 'leave') { primary = 'Player Left'; secondary = `${client} 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 'reply': return ; case 'player': return ; case 'snapshot': return ; default: return ; } }