MCPcopy Create free account
hub / github.com/editablejs/editable / HrComponent

Function HrComponent

packages/plugins/hr/src/components/hr.tsx:14–40  ·  view source on GitHub ↗
({ children, attributes, editor, element })

Source from the content-addressed store, hash-verified

12}
13
14export 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}

Callers

nothing calls this directly

Calls 2

useNodeFocusedFunction · 0.90
useReadOnlyFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…