mirror of
https://github.com/usatiuk/EggbotWireless.git
synced 2025-10-27 09:17:48 +01:00
29 lines
678 B
TypeScript
29 lines
678 B
TypeScript
import React from "react";
|
|
|
|
export interface ICommandsListProps {
|
|
gcodeLinesQueue: string[];
|
|
gcodeLinesSent: string[];
|
|
}
|
|
|
|
function CommandsListComponent({
|
|
gcodeLinesQueue,
|
|
gcodeLinesSent,
|
|
}: ICommandsListProps) {
|
|
const queuedCommandsList = gcodeLinesQueue.map((el, i) => (
|
|
<li key={i}>{el}</li>
|
|
));
|
|
const executedCommandsList = gcodeLinesSent.map((el, i) => (
|
|
<li style={{ color: "green" }} key={i}>
|
|
{el}
|
|
</li>
|
|
));
|
|
|
|
return (
|
|
<ul style={{ listStyle: "none" }}>
|
|
{[...executedCommandsList, ...queuedCommandsList]}
|
|
</ul>
|
|
);
|
|
}
|
|
|
|
export const CommandsList = CommandsListComponent;
|