import React from "react";
import { useShow } from "@refinedev/core";
import { Show } from "@refinedev/antd";
import { Typography } from "antd";
import { useTranslation } from "react-i18next";
import { TiptapEditor } from "@cundi/refine-xaf";

const { Title } = Typography;

export const TiptapTestShow: React.FC = () => {
    const { t } = useTranslation();
    const { query } = useShow();
    const { data, isLoading } = query;
    const record = data?.data;

    return (
        <Show isLoading={isLoading}>
            <Title level={5}>{t("tiptapTest.name")}</Title>
            <p>{record?.Name}</p>

            <Title level={5}>{t("tiptapTest.content")}</Title>
            <TiptapEditor value={record?.Content} disabled />
        </Show>
    );
};
