Create assets helper
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
@@ -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"),
|
||||
|
||||
@@ -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"]>>;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
export const getAssetTypeVariant = (type: string) => {
|
||||
switch (type) {
|
||||
case "PHYSICAL":
|
||||
return "warning";
|
||||
return "neutral";
|
||||
case "VIRTUAL":
|
||||
return "info";
|
||||
default:
|
||||
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user