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" import { HumanDate } from "../HumanDate" type EditableDateRangeProps = { startProps: HTMLProps & {value?: string}, endProps: HTMLProps & {value?: string}, } export function EditableDateRange(props: EditableDateRangeProps) { const [editing,] = useDefinedContext(EditingContext) if(editing) { return ( } start={ } connector={ } end={ } /> ) } const startTime = Date.parse(props.startProps.value!) const endTime = Date.parse(props.endProps.value!) if(Number.isNaN(startTime) && Number.isNaN(endTime)) { return null } const startDate = new Date(startTime) const endDate = new Date(endTime) return ( } start={ } connector={ } end={ } /> ) }