diff --git a/src/Components/Assets/AssetManage.tsx b/src/Components/Assets/AssetManage.tsx index 825cee1c848..4e18c81dc52 100644 --- a/src/Components/Assets/AssetManage.tsx +++ b/src/Components/Assets/AssetManage.tsx @@ -26,7 +26,6 @@ import { UserRole, USER_TYPES } from "../../Common/constants"; import ConfirmDialog from "../Common/ConfirmDialog"; import RecordMeta from "../../CAREUI/display/RecordMeta"; import { useTranslation } from "react-i18next"; -const PageTitle = lazy(() => import("../Common/PageTitle")); const Loading = lazy(() => import("../Common/Loading")); import * as Notification from "../../Utils/Notifications.js"; import { NonReadOnlyUsers } from "../../Utils/AuthorizeFor"; @@ -35,6 +34,7 @@ import useAuthUser from "../../Common/hooks/useAuthUser"; import dayjs from "dayjs"; import RelativeDateUserMention from "../Common/RelativeDateUserMention"; import { AssetServiceEditModal } from "./AssetServiceEditModal"; +import Page from "../Common/components/Page"; interface AssetManageProps { assetId: string; @@ -329,18 +329,28 @@ const AssetManage = (props: AssetManageProps) => { }; return ( -
- + + + Export as JSON + + } + > { {asset?.name} - - - - Export as JSON - - +
+ + {assetClassProp.name} +
+ {asset?.asset_type === "INTERNAL" ? ( + + ) : ( + + )} {asset?.status === "ACTIVE" ? ( ) : ( @@ -402,19 +411,6 @@ const AssetManage = (props: AssetManageProps) => { icon: "location-pin-alt", content: asset?.location_object.name, }, - { - label: "Asset Type", - icon: "apps", - content: - asset?.asset_type === "INTERNAL" - ? "Internal Asset" - : "External Asset", - }, - { - label: "Asset Class", - icon: assetClassProp.icon, - content: assetClassProp.name, - }, { label: "Asset QR Code ID", icon: "qrcode-scan", @@ -585,7 +581,7 @@ const AssetManage = (props: AssetManageProps) => { viewOnly={serviceEditData.viewOnly} /> )} -
+ ); }; diff --git a/src/Components/Assets/AssetWarrantyCard.tsx b/src/Components/Assets/AssetWarrantyCard.tsx index 5d10d4096c8..e1d0384c7f4 100644 --- a/src/Components/Assets/AssetWarrantyCard.tsx +++ b/src/Components/Assets/AssetWarrantyCard.tsx @@ -1,18 +1,23 @@ import CareIcon from "../../CAREUI/icons/CareIcon"; import { AssetData } from "./AssetTypes"; import { classNames, formatDate } from "../../Utils/utils"; +import CopyToClipboard from "react-copy-to-clipboard"; +import { t } from "i18next"; +import { useState } from "react"; export default function AssetWarrantyCard(props: { asset: AssetData }) { const { asset } = props; const details = { "Serial Number": asset.serial_number, - Expiry: + "Warranty/AMC Expiry": asset.warranty_amc_end_of_validity && formatDate(asset.warranty_amc_end_of_validity), Vendor: asset.vendor_name, }; + const [isCopied, setIsCopied] = useState(false); + return (
@@ -25,8 +30,25 @@ export default function AssetWarrantyCard(props: { asset: AssetData }) {
{key}
-
+
{details[key as keyof typeof details] || "--"} + {key === "Serial Number" && ( + + )}
))}