MCPcopy Create free account
hub / github.com/MCSManager/MCSManager / generateTextByItem

Function generateTextByItem

frontend/src/hooks/useOperationLog.ts:153–159  ·  view source on GitHub ↗
(item: OperationLoggerItem)

Source from the content-addressed store, hash-verified

151 };
152
153 const generateTextByItem = (item: OperationLoggerItem) => {
154 const handler = renderMap[item.type];
155 if (!handler) return t("TXT_CODE_43df9305");
156 const { text, data } = handler(item as any);
157 let i = 0;
158 return text.replace(/\<\<\s*[\w_]+\s*\>\>/g, () => data[i++] ?? "--");
159 };
160
161 const getColorByLevel = (level: OperationLoggerItem["operation_level"]) => {
162 return levelColors[level] ?? levelColors.unknown;

Callers 1

useOperationLogFunction · 0.85

Calls 1

handlerFunction · 0.85

Tested by

no test coverage detected