2022-06-07 11:41:26 +00:00
|
|
|
import classNames from "classnames"
|
2022-06-10 15:18:36 +00:00
|
|
|
import { HTMLProps, memo } from "react"
|
2022-06-06 01:15:44 +00:00
|
|
|
|
2022-06-10 15:18:36 +00:00
|
|
|
|
|
|
|
export type FormFromToProps = HTMLProps<HTMLDivElement> & {
|
2022-06-07 11:41:26 +00:00
|
|
|
preview: boolean,
|
2022-06-06 01:15:44 +00:00
|
|
|
}
|
|
|
|
|
2022-06-10 15:18:36 +00:00
|
|
|
export const FormFromTo = memo((props: FormFromToProps) => {
|
|
|
|
return (
|
|
|
|
<div
|
|
|
|
{...props}
|
|
|
|
className={classNames(
|
|
|
|
"form-fromto",
|
|
|
|
props.preview ? "form-fromto-preview" : null,
|
|
|
|
props.className
|
|
|
|
)}
|
|
|
|
/>
|
|
|
|
)
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
export type FormFromToPartProps = HTMLProps<HTMLDivElement> & {
|
|
|
|
part: "icon" | "start" | "connector" | "end"
|
|
|
|
}
|
2022-06-06 01:15:44 +00:00
|
|
|
|
2022-06-10 15:18:36 +00:00
|
|
|
export const FormFromToPart = memo((props: FormFromToPartProps) => {
|
2022-06-06 01:15:44 +00:00
|
|
|
return (
|
2022-06-10 15:18:36 +00:00
|
|
|
<div
|
|
|
|
{...props}
|
|
|
|
className={classNames(
|
|
|
|
`form-fromto-${props.part}`,
|
|
|
|
props.className,
|
|
|
|
)}
|
|
|
|
/>
|
2022-06-06 01:15:44 +00:00
|
|
|
)
|
2022-06-10 15:18:36 +00:00
|
|
|
})
|