Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

1.2 KB
Raw Blame
// SPDX-License-Identifier: AGPL-3.0-only
// Carbon (github.com/crbnos/carbon). Modified or adapted versions of this file,
// including ports, remain AGPLv3; serving them over a network requires releasing their source.

import { cn } from "@carbon/react";
import {
  LuAtom,
  LuCalendar,
  LuHash,
  LuList,
  LuToggleLeft,
  LuType
} from "react-icons/lu";
import type { BatchPropertyDataType } from "./types";

export function ConfiguratorDataTypeIcon({
  type,
  className
}: {
  type: BatchPropertyDataType;
  className?: string;
}) {
  switch (type) {
    case "numeric":
      return <LuHash className={cn("w-4 h-4 text-blue-600", className)} />;
    case "text":
      return <LuType className={cn("w-4 h-4 text-green-600", className)} />;
    case "boolean":
      return (
        <LuToggleLeft className={cn("w-4 h-4 text-purple-600", className)} />
      );
    case "enum":
    case "list":
      return <LuList className={cn("w-4 h-4 text-orange-600", className)} />;
    case "date":
      return <LuCalendar className={cn("w-4 h-4 text-red-600", className)} />;
    case "material":
      return <LuAtom className={cn("w-4 h-4 text-yellow-600", className)} />;
    default:
      return null;
  }
}