update
All checks were successful
Build and Deploy Next.js + Nginx Docker Image / build-and-deploy (push) Successful in 3m0s
Build and Deploy Next.js + Nginx Docker Image / deploy (push) Successful in 7s

This commit is contained in:
Hossein Salari 2026-03-02 16:37:04 +03:30
parent 64907b0ef2
commit 53811e68f8
2 changed files with 44 additions and 22 deletions

View File

@ -178,8 +178,8 @@ export default function TextImagePanel({ filters }) {
type="image" type="image"
loading={isGeneratingImage} loading={isGeneratingImage}
resultData={images} resultData={images}
imgWidth={width} imgWidth={width || 500}
imgHeight={height} imgHeight={height || 500}
/> />
</VStack> </VStack>
); );

View File

@ -29,8 +29,8 @@ function ResultBox({
type = "llm", type = "llm",
loading = false, loading = false,
resultData = "", resultData = "",
imgWidth, imgWidth = 500,
imgHeight, imgHeight = 500,
}) { }) {
return ( return (
<Box <Box
@ -61,7 +61,15 @@ function ResultBox({
</HStack> </HStack>
<FaBolt color="purple" /> <FaBolt color="purple" />
</Box> </Box>
<Box mt={4} mr={2} whiteSpace="pre-line"> <Box
mt={4}
mr={2}
w="100%"
display={type === "image" ? "flex" : "block"}
flexDirection="column"
justifyContent={type === "image" ? "center" : undefined}
whiteSpace={type === "llm" ? "pre-line" : "normal"}
>
{loading && type === "llm" && ( {loading && type === "llm" && (
<HStack <HStack
w="100%" w="100%"
@ -88,28 +96,42 @@ function ResultBox({
)} )}
{type === "image" && loading && ( {type === "image" && loading && (
<VStack align="stretch" spacing={3}> <Box w="100%" display="flex" justifyContent="center">
<Text fontSize="sm" color="gray.600"> <VStack spacing={3} w="100%" maxW="600px">
در حال تولید تصویر... <Text fontSize="sm" color="gray.600" textAlign="center">
</Text> در حال تولید تصویر...
</Text>
<Skeleton borderRadius="md" w={"100%"} h={"500px"} /> <AspectRatio
</VStack> ratio={imgWidth / imgHeight}
w="100%"
borderRadius="md"
overflow="hidden"
>
<Skeleton borderRadius="md" />
</AspectRatio>
</VStack>
</Box>
)} )}
{type === "image" && !loading && resultData?.[0] && ( {type === "image" && !loading && resultData?.[0] && (
<AspectRatio <Box w="100%" display="flex" justifyContent="center">
ratio={imgWidth / imgHeight} <AspectRatio
maxW={"500px"} ratio={imgWidth / imgHeight}
maxH={"500px"} w="100%"
// _before={{ paddingBottom: "70%" }} maxW="600px"
>
<Image
src={resultData?.[0]}
objectFit="contain"
borderRadius="md" borderRadius="md"
/> overflow="hidden"
</AspectRatio> >
<Image
src={resultData?.[0]}
objectFit="contain"
w="100%"
h="100%"
style={{ transform: "translateZ(0)" }}
/>
</AspectRatio>
</Box>
)} )}
</Box> </Box>
</Box> </Box>