/* eslint-disable spire/export-styles */
import PageProps from "@insite/client-framework/Types/PageProps";
import WidgetModule from "@insite/client-framework/Types/WidgetModule";
import WidgetProps from "@insite/client-framework/Types/WidgetProps";
import Typography from "@insite/mobius/Typography";
import React, { FC } from "react";

const enum fields {
    contentField = "contentField",
}

interface Props extends PageProps, WidgetProps {
    fields: {
        [fields.contentField]: string;
    };
}

const LlmsTxtContent: FC<Props> = props => {
    return (
        <div>
            <Typography style={{ whiteSpace: "pre-wrap" }}>{props.fields[fields.contentField]}</Typography>
        </div>
    );
};

const widgetModule: WidgetModule = {
    component: LlmsTxtContent,
    definition: {
        group: "Llms Txt",
        displayName: "Content",
        allowedContexts: ["LlmsTxtPage"],
        fieldDefinitions: [
            {
                name: "contentField",
                displayName: "Content",
                editorTemplate: "MultilineTextField",
                defaultValue: "",
                fieldType: "General",
                isRequired: true,
                sortOrder: 0,
            },
        ],
    },
};

export default widgetModule;
