Skip to content

Commit

Permalink
Add Warn??
Browse files Browse the repository at this point in the history
  • Loading branch information
ShintoKosei committed May 1, 2024
1 parent ed4b82a commit 2d88141
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/components/data/Terminal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,24 @@ function InfoLog({ children }: { children: ReactNode }) {
);
}

function WarnLog({ children }: { children: ReactNode }) {
return (
<div>
<span className="text-amber-200">
[{formatISOFullTime(new Date())} WARN]
</span>
: {children}
</div>
);
}

export function Terminal({ project }: ProjectProps) {
const [cmd, setCmd] = useState("");
const [args, setArgs] = useState("");
const [loading, setLoading] = useState("");
const [output, setOutput] = useState<ReactNode>(null);
const [success, setSuccess] = useState<ReactNode>(null);
const [warn, setWarn] = useState<ReactNode>(null);

useEffect(() => {
const outputLines = [
Expand Down Expand Up @@ -75,6 +87,13 @@ export function Terminal({ project }: ProjectProps) {
</span>
</InfoLog>,
);
setWarn(
<WarnLog>
<span className="text-amber-200">
Can't keep up! Is the server overloaded? Running 5072ms or 101 ticks behind
</span>
</WarnLog>,
);
})();
}, [project.latestStableVersion]);

Expand All @@ -96,6 +115,7 @@ export function Terminal({ project }: ProjectProps) {
</div>
<div>{output}</div>
<div>{success}</div>
<div>{warn}</div>
</div>
</div>
);
Expand Down

0 comments on commit 2d88141

Please sign in to comment.