({
color,
base,
setColor,
children,
}: AdditionalColorPickerProps)
| 106 | }; |
| 107 | |
| 108 | const AdditionalColor = ({ |
| 109 | color, |
| 110 | base, |
| 111 | setColor, |
| 112 | children, |
| 113 | }: AdditionalColorPickerProps) => { |
| 114 | const custom = color && color !== base; |
| 115 | |
| 116 | if (custom) { |
| 117 | return ( |
| 118 | <tr> |
| 119 | <td>{children} (custom)</td> |
| 120 | <td> |
| 121 | <ColorPicker color={color} setColor={setColor} additional /> |
| 122 | <button |
| 123 | className="color-picker-button-cancel" |
| 124 | onClick={() => setColor(undefined)} |
| 125 | > |
| 126 | ✕ |
| 127 | </button> |
| 128 | </td> |
| 129 | </tr> |
| 130 | ); |
| 131 | } |
| 132 | |
| 133 | return ( |
| 134 | <tr> |
| 135 | <td>{children}</td> |
| 136 | <td> |
| 137 | <ColorPicker color={base} setColor={setColor} /> |
| 138 | </td> |
| 139 | </tr> |
| 140 | ); |
| 141 | }; |
| 142 | |
| 143 | const CodePreview = ({ |
| 144 | theme, |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…