import type { CellPluginComponentProps } from '@react-page/editor'; import React from 'react'; import { useEffect, useState } from 'react'; import { Resizable } from 'react-resizable'; import type { SpacerState } from '../types/state'; const faintBlack = 'rgba(0, 0, 0, 0.12)'; const SpacerResizable: React.FC> = ( props ) => { const [height, setHeight] = useState(props.data?.height ?? 24); useEffect(() => setHeight(props.data?.height), [props.data?.height]); const { onChange } = props; return ( { setHeight(size?.height ?? 0); }} onResizeStop={(e, { size }) => onChange({ height: size?.height, }) } height={height} width={0} >
); }; export default SpacerResizable;