/* eslint-disable react/jsx-key */ /* eslint-disable react/prop-types */ /* eslint-disable no-unused-vars */ // eslint-disable-next-line no-unused-vars import React, { useEffect } from "react"; import { Box, Button, Container, Image, Text } from "@chakra-ui/react"; import { useParams } from "react-router-dom"; import { useGetUseCaseQuery } from "../../Redux/slice/useCaseSlice"; import Loader from "../Loader/Loader"; import NotFound from "../../pages/NotFound"; import img from "../../assets/images/pdfscreen.png"; const API_URL = import.meta.env.VITE_API_BASE_URL; // eslint-disable-next-line react/prop-types const NewUseCase = () => { const { title_slug } = useParams(); console.log("title", title_slug); const { data, error, isLoading } = useGetUseCaseQuery(); const useCases = data?.data?.rows; console.log(useCases); useEffect(() => { window.scrollTo(0, 0); }, []); if (isLoading) { return (
); } const matchingUseCase = useCases ? useCases.find((item) => item.title_slug === title_slug) : null; console.log(matchingUseCase); return ( <> {matchingUseCase ? (
{matchingUseCase.title} {matchingUseCase.meta_description} {/* ========[ Head-Para ]====== */} {matchingUseCase.content != "


" ? ( ) : null}
{matchingUseCase.attachments.length >= 1 ? ( Use Cases ) : ( "" )} {matchingUseCase.attachments.map((item) => ( {item.originalname} { } ))}
) : ( )} ); }; export default NewUseCase;