import { PropertyType } from "~/application/enums/entities/PropertyType"; import { PropertyWithDetails } from "../db/entities/entities.db.server"; import { RowValueWithDetails } from "../db/entities/rows.db.server"; import RowHelper from "./RowHelper"; import { PropertyAttributeName } from "~/application/enums/entities/PropertyAttributeName"; import { MediaDto } from "~/application/dtos/entities/MediaDto"; import { RowValueRangeDto } from "~/application/dtos/entities/RowValueRangeDto"; import PropertyFormulaValueBadge from "~/components/entities/properties/PropertyFormulaValueBadge"; import PropertyMultipleValueBadge from "~/components/entities/properties/PropertyMultipleValueBadge"; import RowBooleanCell from "~/components/entities/rows/cells/RowBooleanCell"; import RowDateCell from "~/components/entities/rows/cells/RowDateCell"; import RowMediaCell from "~/components/entities/rows/cells/RowMediaCell"; import RowNumberCell from "~/components/entities/rows/cells/RowNumberCell"; import RowRangeDateCell from "~/components/entities/rows/cells/RowRangeDateCell"; import RowRangeNumberCell from "~/components/entities/rows/cells/RowRangeNumberCell"; import { BooleanFormatType } from "../shared/BooleanUtils"; import { DateFormatType } from "../shared/DateUtils"; import { NumberFormatType } from "../shared/NumberUtils"; import { SelectOptionsDisplay } from "../shared/SelectOptionsUtils"; import PropertyAttributeHelper from "./PropertyAttributeHelper"; import { renderSanitizedMarkdown } from "~/utils/html-sanitizer"; import RowSelectedOptionCell from "~/components/entities/rows/cells/RowSelectedOptionCell"; import { RowValueMultipleDto } from "~/application/dtos/entities/RowValueMultipleDto"; interface Props { property: PropertyWithDetails; value: RowValueWithDetails | null | undefined; withTitle?: boolean; } export default function RowValueUI({ property, value, withTitle }: Props) { const rowValue = value ? RowHelper.getDynamicPropertyValue(value, property.type) : undefined; const entityName = (property as PropertyWithDetails & { entity?: { name: string } }).entity?.name; if (rowValue === null || rowValue === undefined) { return null; } if (property.type === PropertyType.BOOLEAN) { const format = property.attributes.find((f) => f.name === PropertyAttributeName.FormatBoolean)?.value; return (