Changed translated labels to static suffixes, cleanup.

This commit is contained in:
jstnlowe 2024-06-04 21:13:09 -04:00 committed by psychedelicious
parent 9cba0dfac9
commit 848ca79da8
4 changed files with 21 additions and 5 deletions

View File

@ -33,7 +33,7 @@ const DataViewer = (props: Props) => {
const blob = new Blob([dataString]); const blob = new Blob([dataString]);
const a = document.createElement('a'); const a = document.createElement('a');
a.href = URL.createObjectURL(blob); a.href = URL.createObjectURL(blob);
a.download = `${ fileName || label }.json`; a.download = `${fileName || label}.json`;
document.body.appendChild(a); document.body.appendChild(a);
a.click(); a.click();
a.remove(); a.remove();

View File

@ -28,7 +28,9 @@ const ImageMetadataGraphTabContent = ({ image }: Props) => {
return <IAINoContentFallback label={t('nodes.noGraph')} />; return <IAINoContentFallback label={t('nodes.noGraph')} />;
} }
return <DataViewer fileName={`${image.image_name.replace('.png','')}_${t('nodes.graph')}`} data={graph} label={t('nodes.graph')} />; return (
<DataViewer fileName={`${image.image_name.replace('.png', '')}_graph`} data={graph} label={t('nodes.graph')} />
);
}; };
export default memo(ImageMetadataGraphTabContent); export default memo(ImageMetadataGraphTabContent);

View File

@ -68,14 +68,22 @@ const ImageMetadataViewer = ({ image }: ImageMetadataViewerProps) => {
</TabPanel> </TabPanel>
<TabPanel> <TabPanel>
{metadata ? ( {metadata ? (
<DataViewer fileName={`${image.image_name.replace('.png','')}_${t('metadata.metadata')}`} data={metadata} label={t('metadata.metadata')} /> <DataViewer
fileName={`${image.image_name.replace('.png', '')}_metadata`}
data={metadata}
label={t('metadata.metadata')}
/>
) : ( ) : (
<IAINoContentFallback label={t('metadata.noMetaData')} /> <IAINoContentFallback label={t('metadata.noMetaData')} />
)} )}
</TabPanel> </TabPanel>
<TabPanel> <TabPanel>
{image ? ( {image ? (
<DataViewer fileName={`${image.image_name.replace('.png','')}_${t('metadata.imageDetails')}`} data={image} label={t('metadata.imageDetails')} /> <DataViewer
fileName={`${image.image_name.replace('.png', '')}_details`}
data={image}
label={t('metadata.imageDetails')}
/>
) : ( ) : (
<IAINoContentFallback label={t('metadata.noImageDetails')} /> <IAINoContentFallback label={t('metadata.noImageDetails')} />
)} )}

View File

@ -28,7 +28,13 @@ const ImageMetadataWorkflowTabContent = ({ image }: Props) => {
return <IAINoContentFallback label={t('nodes.noWorkflow')} />; return <IAINoContentFallback label={t('nodes.noWorkflow')} />;
} }
return <DataViewer fileName={`${image.image_name.replace('.png','')}_${t('metadata.workflow')}`} data={workflow} label={t('metadata.workflow')} />; return (
<DataViewer
fileName={`${image.image_name.replace('.png', '')}_workflow`}
data={workflow}
label={t('metadata.workflow')}
/>
);
}; };
export default memo(ImageMetadataWorkflowTabContent); export default memo(ImageMetadataWorkflowTabContent);