Files
oneuptime/Common/UI/Components/Events/RecurringArrayViewElement.tsx
Simon Larsen ebd14dd497 Refactor import paths in Workflow components to use relative paths from Types directory
- Updated import statements in ComponentSettingsModal, ComponentValuePickerModal, ComponentsModal, DocumentationViewer, RunForm, RunModal, Utils, VariableModal, Workflow, WorkflowStatus, Config, EntityFieldType, and various API utility files to reflect the new directory structure.
- Ensured all imports from "Common/Types" are now sourced from "../../../Types" to maintain consistency and improve module resolution.
2025-05-21 14:02:32 +01:00

39 lines
1.0 KiB
TypeScript

import Recurring from "../../../Types/Events/Recurring";
import React, { FunctionComponent, ReactElement } from "react";
import RecurringViewElement from "./RecurringViewElement";
export interface ComponentProps {
value?: Array<Recurring> | undefined;
postfix?: string | undefined;
noItemsMessage?: string | undefined;
}
const RecurringArrayViewElement: FunctionComponent<ComponentProps> = (
props: ComponentProps,
): ReactElement => {
if (!props.value) {
return <p>-</p>;
}
const items: Array<Recurring> = Recurring.fromJSONArray(props.value);
return (
<div className="space-y-2">
{items &&
items.length > 0 &&
items.map((item: Recurring, index: number) => {
return (
<RecurringViewElement
key={index}
value={item}
postfix={props.postfix}
/>
);
})}
{(!items || items.length === 0) && <p>{props.noItemsMessage || "-"}</p>}
</div>
);
};
export default RecurringArrayViewElement;