Files
oneuptime/Common/UI/Components/Events/RecurringViewElement.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

30 lines
788 B
TypeScript

import EventInterval from "../../../Types/Events/EventInterval";
import Recurring from "../../../Types/Events/Recurring";
import React, { FunctionComponent, ReactElement } from "react";
export interface ComponentProps {
value?: Recurring | undefined;
postfix?: string | undefined;
}
const RecurringViewElement: FunctionComponent<ComponentProps> = (
props: ComponentProps,
): ReactElement => {
if (!props.value) {
return <p>-</p>;
}
const value: Recurring = Recurring.fromJSON(props.value);
return (
<p>
{value.intervalCount?.toString()}{" "}
{EventInterval[value.intervalType]?.toString()}
{value.intervalCount && value.intervalCount.toNumber() > 1 ? "s" : ""}
{props.postfix || ""}
</p>
);
};
export default RecurringViewElement;