diff --git a/src/photo/form/PhotoForm.tsx b/src/photo/form/PhotoForm.tsx index b9443e70..f6bcf950 100644 --- a/src/photo/form/PhotoForm.tsx +++ b/src/photo/form/PhotoForm.tsx @@ -122,35 +122,43 @@ export default function PhotoForm({ requestTitle, title, isLoadingTitle, + errorTitle, ] = useImageQuery(imageData, 'title'); const [ requestTags, tags, isLoadingTags, + errorTags, ] = useImageQuery(imageData, 'tags'); const [ requestDescriptionSmall, descriptionSmall, isLoadingDescriptionSmall, + errorDescriptionSmall, ] = useImageQuery(imageData, 'descriptionSmall'); const [ requestDescriptionLarge, descriptionLarge, isLoadingDescriptionLarge, + errorDescriptionLarge, ] = useImageQuery(imageData, 'descriptionLarge'); const renderAiButton = ( label: string, onClick: () => void, isLoading: boolean, + error?: any, ) => ; @@ -158,17 +166,29 @@ export default function PhotoForm({ return (
- {renderAiButton('Title', requestTitle, isLoadingTitle)} - {renderAiButton('Tags', requestTags, isLoadingTags)} + {renderAiButton( + 'Title', + requestTitle, + isLoadingTitle, + errorTitle, + )} + {renderAiButton( + 'Tags', + requestTags, + isLoadingTags, + errorTags, + )} {renderAiButton( 'Description (S)', requestDescriptionSmall, isLoadingDescriptionSmall, + errorDescriptionSmall, )} {renderAiButton( 'Description (L)', requestDescriptionLarge, isLoadingDescriptionLarge, + errorDescriptionLarge, )}