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

Function renderButton

packages/ui/src/toolbar.tsx:19–38  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

17 ({ title, children, onToggle, active, ...props }, ref) => {
18 const { side } = useToolbarContext()
19 const renderButton = () => (
20 <Button
21 css={[
22 tw`shadow-none w-7 h-7`,
23 css`
24 &[data-active='true'] {
25 ${tw`text-primary bg-blue-100 border-blue-100 hover:bg-blue-100 hover:text-primary hover:border-blue-100`}
26 }
27 `,
28 children && tw`w-auto`,
29 ]}
30 data-active={active || undefined}
31 onClick={onToggle}
32 type={active ? 'primary' : 'text'}
33 {...props}
34 ref={ref}
35 >
36 {children}
37 </Button>
38 )
39 return title ? (
40 <Tooltip content={title} side={side}>
41 {renderButton()}

Callers 2

toolbar.tsxFile · 0.85
index.tsxFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…