mirror of
https://github.com/usatiuk/EggbotWireless.git
synced 2025-10-27 17:27:49 +01:00
better web app layout
This commit is contained in:
28
App/src/CommandsList.tsx
Normal file
28
App/src/CommandsList.tsx
Normal file
@@ -0,0 +1,28 @@
|
||||
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;
|
||||
Reference in New Issue
Block a user