From 11c76a07254a3a4807ca159cf983ce69d7c55952 Mon Sep 17 00:00:00 2001 From: Tom Butcher Date: Mon, 18 Aug 2025 01:03:44 +0100 Subject: [PATCH] Refactor PrinterJobsTree component to enhance state display - Replaced JobState and SubJobState components with a unified StateDisplay component for improved consistency in state representation. - Updated the rendering logic to utilize StateDisplay for both job and sub-job states, enhancing code clarity and maintainability. --- src/components/Dashboard/common/PrinterJobsTree.jsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/components/Dashboard/common/PrinterJobsTree.jsx b/src/components/Dashboard/common/PrinterJobsTree.jsx index 426a8d9..0f7d0a0 100644 --- a/src/components/Dashboard/common/PrinterJobsTree.jsx +++ b/src/components/Dashboard/common/PrinterJobsTree.jsx @@ -3,15 +3,14 @@ import { Card, Tree, Spin, Space, Button, message } from 'antd' import { LoadingOutlined } from '@ant-design/icons' import React, { useState, useEffect, useContext } from 'react' import { useNavigate } from 'react-router-dom' -import SubJobState from './SubJobState' import { PrintServerContext } from '../context/PrintServerContext' import axios from 'axios' -import JobState from './JobState' import JobIcon from '../../Icons/JobIcon' import SubJobIcon from '../../Icons/SubJobIcon' import ReloadIcon from '../../Icons/ReloadIcon' import config from '../../../config' +import StateDisplay from './StateDisplay' const PrinterJobsTree = ({ subJobs: initialSubJobs, @@ -62,7 +61,7 @@ const PrinterJobsTree = ({ {'Job'} - + ), key: `job-${job._id}`, @@ -71,8 +70,8 @@ const PrinterJobsTree = ({ {'Sub Job'} -