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.
30 lines
788 B
TypeScript
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;
|