import { reflect } from '@cn-ui/use'; import { AIImageInfo } from 'prompt-extractor'; import { Show, useContext } from 'solid-js'; import { GalleryGlobal } from '../App'; import { GalleryPanel } from '../components/GalleryPanel'; import { AIImageInfoShower } from '../../src/components/AIImageInfoShower'; export const getImagePath = (s: string) => { return s.replace('/t/', '/s/').replace('.jpg', '.png'); }; export const DetailPanel = () => { const { ShowingPicture, showingData, getViewer } = useContext(GalleryGlobal); const details = reflect(() => { if (!ShowingPicture()) return null; const information = Object.fromEntries( JSON.parse(ShowingPicture()?.other || '[]') ) as AIImageInfo; if (!information.Description) { information.Description = ShowingPicture().tags; } return information; }); return (
{ShowingPicture().description}
); };