({ items, ...buttonProps }: ExportButtonProps)
| 16 | } |
| 17 | |
| 18 | export function ExportButton({ items, ...buttonProps }: ExportButtonProps): JSX.Element { |
| 19 | return ( |
| 20 | <LemonButtonWithPopup |
| 21 | status="stealth" |
| 22 | data-attr="export-button" |
| 23 | {...buttonProps} |
| 24 | popup={{ |
| 25 | actionable: true, |
| 26 | placement: 'right-start', |
| 27 | closeParentPopupOnClickInside: true, |
| 28 | overlay: ( |
| 29 | <> |
| 30 | <h5>File type</h5> |
| 31 | <LemonDivider /> |
| 32 | {items.map(({ title, ...triggerExportProps }, i) => { |
| 33 | const exportFormatExtension = triggerExportProps.export_format.split('/').pop() |
| 34 | |
| 35 | return ( |
| 36 | <LemonButton |
| 37 | key={i} |
| 38 | fullWidth |
| 39 | status="stealth" |
| 40 | onClick={() => triggerExport(triggerExportProps)} |
| 41 | data-attr={`export-button-${exportFormatExtension}`} |
| 42 | > |
| 43 | {title ? title : `.${exportFormatExtension}`} |
| 44 | </LemonButton> |
| 45 | ) |
| 46 | })} |
| 47 | </> |
| 48 | ), |
| 49 | }} |
| 50 | > |
| 51 | Export |
| 52 | </LemonButtonWithPopup> |
| 53 | ) |
| 54 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…