(props: DragPreviewProps)
| 151 | * contents, use Text with the "label" and "description" slots and/or a Icon for the leading icon. |
| 152 | */ |
| 153 | export function DragPreview(props: DragPreviewProps) { |
| 154 | let {items, overflowMode} = props; |
| 155 | let isDraggingMultiple = items.length > 1; |
| 156 | let itemLabel = items[0]?.['text/plain'] ?? ''; |
| 157 | let scale = useScale(); |
| 158 | |
| 159 | return ( |
| 160 | <div className={dragPreviewWrapper}> |
| 161 | {isDraggingMultiple && <div className={dragPreviewCardBack} />} |
| 162 | <div className={dragPreviewCard({scale})}> |
| 163 | <Provider |
| 164 | values={[ |
| 165 | [ |
| 166 | TextContext, |
| 167 | { |
| 168 | slots: { |
| 169 | [DEFAULT_SLOT]: {styles: label({overflowMode})}, |
| 170 | label: {styles: label({overflowMode})}, |
| 171 | description: {styles: description({overflowMode})} |
| 172 | } |
| 173 | } |
| 174 | ], |
| 175 | [ |
| 176 | IconContext, |
| 177 | { |
| 178 | slots: { |
| 179 | icon: { |
| 180 | render: centerBaseline({slot: 'icon', styles: iconCenterWrapper}), |
| 181 | styles: icon |
| 182 | } |
| 183 | } |
| 184 | } |
| 185 | ] |
| 186 | ]}> |
| 187 | {props.children ?? <Text>{itemLabel}</Text>} |
| 188 | {isDraggingMultiple && <div className={dragPreviewBadge}>{items.length}</div>} |
| 189 | </Provider> |
| 190 | </div> |
| 191 | </div> |
| 192 | ); |
| 193 | } |
nothing calls this directly
no test coverage detected