fix: customization types (#4321)

This commit is contained in:
Pedro H. Köhler 2024-07-31 12:21:51 -03:00 committed by GitHub
parent 50669867c9
commit 72bef63ef6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 2 deletions

View File

@ -9,6 +9,7 @@ export interface BaseCustomization extends Obj {
description?: string;
label?: string;
commands?: Command[];
content?: (...props: any) => React.JSX.Element;
}
export interface LabelCustomization extends BaseCustomization {
@ -23,11 +24,16 @@ export interface CommandCustomization extends BaseCustomization {
commands: Command[];
}
export interface ComponentCustomization extends BaseCustomization {
content: (...props: any) => React.JSX.Element;
}
export type Customization =
| BaseCustomization
| LabelCustomization
| CommandCustomization
| CodeCustomization;
| CodeCustomization
| ComponentCustomization;
export default Customization;

View File

@ -1,6 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { useTranslation } from 'react-i18next';
import { Types } from '@ohif/core';
import MeasurementItem from './MeasurementItem';
@ -17,9 +18,11 @@ const MeasurementTable = ({
const amount = data.length;
const itemCustomization = customizationService.getCustomization('MeasurementItem', {
id: 'MeasurementItem',
content: MeasurementItem,
contentProps: {},
});
}) as Types.Customization;
const CustomMeasurementItem = itemCustomization.content;
const onMeasurementDeleteHandler = ({ uid }) => {