({ event })
| 125 | }; |
| 126 | |
| 127 | const Event = ({ event }) => { |
| 128 | const [dateFormatSetting] = useLocalStorage('date-format', 'mdy'); |
| 129 | const dateFormat = dateFormatSetting === 'mdy' ? 'MM/DD' : 'DD/MM'; |
| 130 | |
| 131 | return ( |
| 132 | <Box |
| 133 | p="xs" |
| 134 | bdrs={4} |
| 135 | style={{ |
| 136 | backgroundColor: '#1A1B1E', |
| 137 | borderLeft: `3px solid var(--mantine-color-${getEventColor(event.event_type)}-6)`, |
| 138 | }} |
| 139 | > |
| 140 | <Group justify="space-between" wrap="nowrap"> |
| 141 | <Group gap="xs" flex={1} miw={0}> |
| 142 | <Box c={`${getEventColor(event.event_type)}.6`}> |
| 143 | {getEventIcon(event.event_type)} |
| 144 | </Box> |
| 145 | <Stack gap={2} flex={1} miw={0}> |
| 146 | <Group gap="xs" wrap="nowrap"> |
| 147 | <Text size="sm" fw={500}> |
| 148 | {event.event_type_display || event.event_type} |
| 149 | </Text> |
| 150 | {event.channel_name && ( |
| 151 | <Text size="sm" c="dimmed" truncate maw={300}> |
| 152 | {event.channel_name} |
| 153 | </Text> |
| 154 | )} |
| 155 | </Group> |
| 156 | {event.details && Object.keys(event.details).length > 0 && ( |
| 157 | <Text size="xs" c="dimmed"> |
| 158 | {Object.entries(event.details) |
| 159 | .filter(([key]) => !['stream_url', 'new_url'].includes(key)) |
| 160 | .map(([key, value]) => `${key}: ${value}`) |
| 161 | .join(', ')} |
| 162 | </Text> |
| 163 | )} |
| 164 | </Stack> |
| 165 | </Group> |
| 166 | <Text size="xs" c="dimmed" style={{ whiteSpace: 'nowrap' }}> |
| 167 | {format(event.timestamp, `${dateFormat} HH:mm:ss`)} |
| 168 | </Text> |
| 169 | </Group> |
| 170 | </Box> |
| 171 | ); |
| 172 | }; |
| 173 | |
| 174 | const SystemEvents = () => { |
| 175 | const [events, setEvents] = useState([]); |
nothing calls this directly
no test coverage detected