Create assets helper

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
Sacha Al Himdani
2025-06-12 19:45:15 -07:00
parent 24154cc3a2
commit 187bc84365
4 changed files with 4 additions and 3 deletions

View File

@@ -25,7 +25,7 @@ import { PeopleSelectField } from "/components/form/PeopleSelectField";
import { VendorsMultiSelectField } from "/components/form/VendorsMultiSelectField";
import { useFormWithSchema } from "/hooks/useFormWithSchema";
import z from "zod";
import { getAssetTypeVariant, getCriticityVariant } from "./utils/badgeVariants";
import { getAssetTypeVariant, getCriticityVariant } from "@probo/helpers";
const updateAssetSchema = z.object({
name: z.string().min(1, "Name is required"),

View File

@@ -23,7 +23,7 @@ import { useDeleteAsset, useAssets } from "../../../hooks/graph/AssetGraph";
import type { AssetGraphListQuery } from "/hooks/graph/__generated__/AssetGraphListQuery.graphql";
import { faviconUrl } from "@probo/helpers";
import type { NodeOf } from "/types";
import { getAssetTypeVariant, getCriticityVariant } from "./utils/badgeVariants";
import { getAssetTypeVariant, getCriticityVariant } from "@probo/helpers";
type AssetEntry = NodeOf<NonNullable<NonNullable<AssetGraphListQuery["response"]["node"]>["assets"]>>;

View File

@@ -1,7 +1,7 @@
export const getAssetTypeVariant = (type: string) => {
switch (type) {
case "PHYSICAL":
return "warning";
return "neutral";
case "VIRTUAL":
return "info";
default:

View File

@@ -14,5 +14,6 @@ export { getRole, getRoles, peopleRoles } from "./people";
export { certificationCategoryLabel, certifications } from "./certifications";
export { availableFrameworks } from "./frameworks";
export { getDocumentTypeLabel, documentTypes } from "./documents";
export { getAssetTypeVariant, getCriticityVariant } from "./assets";
export { promisifyMutation } from "./relay";
export { fileType, fileSize } from "./file";