• This function simplifies access to the shared functionality provided by the image workflow in the PiletApi object. In case the shared functionality is not available, a fallback renderer is returned.

    Make sure to initialize the integration library by calling the initializeIntegrationLib function, otherwise it will always return the fallback renderer.

    The renderer expects that the column is bound to the property containing the state. The thumbnail property is passed as an argument.

    Type Parameters

    • T extends Data

    Parameters

    • thumbnailPropertyOrResolver: keyof T | ThumbnailResolver<T>

      Either the name of a property on the data object that has the following shape:

      {
      nodes: [{
      imageId: 'b437056b-c28e-46fa-ad9d-8bd16e7609fa'
      }]
      }

      This reflects the shape a typical postgraphile response would have. The renderer will pick the fist imageId from the nodes array.

      Alternatively a callback function can be passed that resolves to a url location. The row data is passed as an argument. The method can either return the full url of the image or the uuid of the image. If the uuid is returned, the resolverType argument needs to be set to 'uuid'.

    • Optional stateMap: ColumnMap

      An object of key/value pairs mapping column values to CSS colors. If an empty object is passed, no state will be rendered.

      {
      'PUBLISHED': '#95C842',
      'CHANGED': '#FFC81A',
      'NOT_PUBLISHED': '#DDDDDD',
      }
    • Optional resolverType: ThumbnailResolverType

      either 'url' or 'uuid', depending on what your resolver is returning.

    Returns ColumnRenderer<T>

    A thumbnail and state column renderer

Generated using TypeDoc