import type { UIPluginOptions, Uppy } from '@uppy/core' import { Component, type ComponentChild } from 'preact' import FadeIn from './FadeIn.js' import TransitionGroup from './TransitionGroup.js' export type InformerOptions = UIPluginOptions /** * Informer * Shows rad message bubbles * used like this: `uppy.info('hello world', 'info', 5000)` * or for errors: `uppy.info('Error uploading img.jpg', 'error', 5000)` * */ type InformerProps = { uppy: Uppy } export default class Informer extends Component { render(): ComponentChild { // Get info from the uppy instance passed in props const { info } = this.props.uppy.getState() return (
{info.map((info) => (

{info.message}{' '} {info.details && ( // biome-ignore lint/a11y/useKeyWithClickEvents: don't think it's needed alert(`${info.message} \n\n ${info.details}`) } > ? )}

))}
) } }