import { RenderModalCtx } from 'datocms-plugin-sdk' import { Canvas } from 'datocms-react-ui' import clsx from 'clsx' import { RasterLibraries, RasterPreview, RasterImages, useSelectedImages, } from '@raster-app/raster-toolkit' type Props = { ctx: RenderModalCtx } const Selector = ({ ctx }: Props) => { const { count, images: selectedPhotos } = useSelectedImages() const orgId = ctx.plugin.attributes.parameters.orgId as string const apiKey = ctx.plugin.attributes.parameters.apiKey as string const { selectedPhotos: initialValue } = ctx.parameters ?? {} if (!orgId || !apiKey) { return <>Please configure the plugin first } return (

Select an image from Raster

{count > 0 && ( )}
{/* Libraries */} {/* Selected images */}

{/* Selected images count, cancel and confirm buttons */}
0 ? 'translate-y-0 opacity-100' : 'translate-y-full opacity-0' )} > {count} selected
) } export default Selector