Skip to content

Commit

Permalink
fix: customization types
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrokohler committed Jul 31, 2024
1 parent 5066986 commit 957e91a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
8 changes: 7 additions & 1 deletion platform/core/src/services/CustomizationService/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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;

Expand Down
Original file line number Diff line number Diff line change
@@ -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';

Expand All @@ -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 }) => {
Expand Down

0 comments on commit 957e91a

Please sign in to comment.