mirror of
https://github.com/outline/outline.git
synced 2026-11-25 07:04:37 +03:00
27 lines
731 B
TypeScript
27 lines
731 B
TypeScript
import {
|
|
CaseSensitiveIcon,
|
|
DoneIcon,
|
|
HashtagIcon,
|
|
TableOfContentsIcon,
|
|
} from "outline-icons";
|
|
import * as React from "react";
|
|
import { DataAttributeDataType } from "@shared/models/types";
|
|
import DataAttribute from "~/models/DataAttribute";
|
|
|
|
export class DataAttributesHelper {
|
|
public static getIcon(dataAttribute: DataAttribute) {
|
|
switch (dataAttribute.dataType) {
|
|
case DataAttributeDataType.Boolean:
|
|
return <DoneIcon />;
|
|
case DataAttributeDataType.Number:
|
|
return <HashtagIcon />;
|
|
case DataAttributeDataType.String:
|
|
return <CaseSensitiveIcon />;
|
|
case DataAttributeDataType.List:
|
|
return <TableOfContentsIcon />;
|
|
default:
|
|
return null;
|
|
}
|
|
}
|
|
}
|