added logs list
This commit is contained in:
@@ -1,10 +1,28 @@
|
||||
import React from "react";
|
||||
import { HelpIcon } from "../../icons/DashboardIcon";
|
||||
import { useLogger } from "../log/LoggerContext";
|
||||
import {
|
||||
LogInfoIcon,
|
||||
ErrorIcon,
|
||||
WarningIcon,
|
||||
} from "../../icons/ExportCommonIcons"; // Adjust path as needed
|
||||
|
||||
const getLogIcon = (type: string) => {
|
||||
switch (type) {
|
||||
case "info":
|
||||
return <LogInfoIcon />;
|
||||
case "error":
|
||||
return <ErrorIcon />;
|
||||
case "warning":
|
||||
return <WarningIcon />;
|
||||
case "log":
|
||||
default:
|
||||
return <LogInfoIcon />;
|
||||
}
|
||||
};
|
||||
|
||||
const Footer = () => {
|
||||
const { logs, setIsLogListVisible } = useLogger();
|
||||
|
||||
const lastLog = logs.length > 0 ? logs[logs.length - 1] : null;
|
||||
|
||||
return (
|
||||
@@ -26,9 +44,14 @@ const Footer = () => {
|
||||
|
||||
<div className="logs-wrapper">
|
||||
<div className="logs-detail" onClick={() => setIsLogListVisible(true)}>
|
||||
{lastLog
|
||||
? `[${lastLog.type.toUpperCase()}] ${lastLog.message}`
|
||||
: "No logs yet."}
|
||||
{lastLog ? (
|
||||
<>
|
||||
<span className="log-icon">{getLogIcon(lastLog.type)}</span>
|
||||
<span className="log-message">{lastLog.message}</span>
|
||||
</>
|
||||
) : (
|
||||
"No logs yet."
|
||||
)}
|
||||
</div>
|
||||
<div className="version">
|
||||
V 0.01
|
||||
|
||||
Reference in New Issue
Block a user