"use client"
import PageTitleWithLogo from "@/components/ui/PageTitleWithLogo"
import useGetQuery from "@/hooks/useGetQuery"

const TermsDescription = ({ lang }: { lang: Lang }) => {
    const { data } = useGetQuery<TermsType>({
        endpoint: "api/setting_web/terms",
        queryKey: ["terms", lang],
        staleTime: 50000,
    })

    if (!data) return null

    return (
        <>
            <PageTitleWithLogo title="terms and conditions" />
            <pre className="text-mainGray mt-9 leading-[30px] overflow-hidden  whitespace-pre-wrap break-words font-sans">
                {data?.data?.text?.[lang]}
            </pre>
        </>
    )
}

export default TermsDescription
