diff --git a/src/apps/draw/DrawGallery.tsx b/src/apps/draw/DrawGallery.tsx index 83bada6df..fd0b19faf 100644 --- a/src/apps/draw/DrawGallery.tsx +++ b/src/apps/draw/DrawGallery.tsx @@ -1,42 +1,38 @@ import * as React from 'react'; - -import { AppPlaceholder } from '../AppPlaceholder'; -import { useDBlobItemsByTypeCIdSId } from '~/modules/dblobs/dblobs.hooks'; -import { DBlobImageItem, DBlobMetaDataType } from '~/modules/dblobs/dblobs.types'; import { Box, Table } from '@mui/joy'; +import { dBlobCacheT256, DBlobImageItem, DBlobMetaDataType } from '~/modules/dblobs/dblobs.types'; +import { useDBlobItemsByTypeCIdSId } from '~/modules/dblobs/dblobs.hooks'; -export function DrawGallery(props: { domain: 'draw' | 'app' }) { +import { AppPlaceholder } from '../AppPlaceholder'; - // external state from the DB + +export function DrawGallery({ domain }: { domain: 'draw' | 'app' }) { const [items] = useDBlobItemsByTypeCIdSId( DBlobMetaDataType.IMAGE, 'global', - props.domain === 'draw' ? 'app-draw' : 'app-chat', + domain === 'draw' ? 'app-draw' : 'app-chat', ); - // wait until we load everything if (!items || items.length === 0) { - return ( - - ); + return ; } - return ( - + const boxStyles = { + flexGrow: 1, + overflowY: 'auto', + p: { xs: 3, md: 6 }, + border: '1px solid blue', + }; - + const cellStyles = { + overflowWrap: 'anywhere', + whiteSpace: 'break-spaces', + }; + + return ( + +
@@ -46,50 +42,34 @@ export function DrawGallery(props: { domain: 'draw' | 'app' }) { - {items.map((_item) => { - const { - id, - label, - data, - origin, - metadata, - createdAt, - updatedAt, - } = _item; - return ( - - - - - - - ); - })} + {items.map(({ id, label, cache, data, origin, metadata, createdAt, updatedAt }) => ( + + + + + + + ))}
ID
- - {label} - - {label} - - {JSON.stringify(origin, null, 2)} - - - - {JSON.stringify(metadata, null, 2)} -
- {createdAt ? new Date(createdAt).toLocaleString() : 'no creation'} -
- {(updatedAt && updatedAt !== createdAt) ? new Date(updatedAt).toLocaleString() : null} -
-
+ + {label} + + {label} + {JSON.stringify(origin, null, 2)} + + + {JSON.stringify(metadata, null, 2)} +
+ {createdAt ? new Date(createdAt).toLocaleString() : 'no creation'} +
+ {updatedAt && updatedAt !== createdAt ? new Date(updatedAt).toLocaleString() : null} +
+
-
); } \ No newline at end of file