mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-04-06 00:32:12 +02:00
- 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.
39 lines
1.0 KiB
TypeScript
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;
|