import { faChevronRight, faClock } from "@fortawesome/free-solid-svg-icons" import { HTMLProps } from "react" import { EditingContext } from "../../contexts/editing" import { useDefinedContext } from "../../utils/definedContext" import { FestaIcon } from "../extensions/FestaIcon" import { FormDateRange } from "../form/FormDateRange" type EditableDateRangeProps = { startProps: HTMLProps & {value?: string}, endProps: HTMLProps & {value?: string}, } export function EditableDateRange(props: EditableDateRangeProps) { const [editing,] = useDefinedContext(EditingContext) const startDate = props.startProps return editing ? ( } start={ } connector={ } end={ } /> ) : ( } start={ new Date(Date.parse(props.startProps.value!)).toLocaleString() } connector={ } end={ new Date(Date.parse(props.endProps.value!)).toLocaleString() } /> ) }