({ children, attributes, editor, element })
| 12 | } |
| 13 | |
| 14 | export const HrComponent: FC<HrProps> = ({ children, attributes, editor, element }) => { |
| 15 | const focused = useNodeFocused() |
| 16 | const [readOnly] = useReadOnly() |
| 17 | const { color = DEFUALT_HR_COLOR, width = DEFAULT_HR_WIDTH, style = DEFAULT_HR_STYLE } = element |
| 18 | return ( |
| 19 | <HrPopover editor={editor} element={element}> |
| 20 | <div |
| 21 | css={[ |
| 22 | tw`py-4 rounded cursor-default`, |
| 23 | !readOnly && tw`hover:bg-gray-100`, |
| 24 | focused && !readOnly && tw`bg-gray-100`, |
| 25 | ]} |
| 26 | {...attributes} |
| 27 | > |
| 28 | <hr |
| 29 | css={[ |
| 30 | css` |
| 31 | border-top: ${width}px ${style} ${color}; |
| 32 | `, |
| 33 | ]} |
| 34 | /> |
| 35 | |
| 36 | <div tw="hidden absolute">{children}</div> |
| 37 | </div> |
| 38 | </HrPopover> |
| 39 | ) |
| 40 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…