import { ModelConfig } from "../.types";
import { pageActions, PAGE_SIZE } from "./_common";

export const Log: ModelConfig = {
  metadata: {
    nameKeys: ["id"],
    pageActions,
  },
  table: {
    toolbar: {
      searchBar: {
        fields: ["resourceId", "creator"],
        containsFields: [],
        placeholder: "resourceId, creator",
      },
      actions: [
        { action: "REFRESH", desc: "Refresh" },
        { action: "SETTING", desc: "Setting" },
        {
          action: "EXPORT",
          desc: "export",
          fields: ["*"],
        },
      ],
    },
    header: {
      filter: [],
      sorter: ["id"],
    },
    fields: ["*", "!authorId", "!authorName", "!data", "!previousData"],
    rowSelection: {
      actions: [{ action: "EXPORT", desc: "Export" }],
    },
    rowActions: {
      visibleNum: 2,
      actions: [],
    },
    params: {
      pageSize: PAGE_SIZE,
    },
  },
  form: {
    fields: ["*", "!creator", "!timestamp"],
    reaction: {
      id: {
        toggle: [],
        defaultProps: {
          hidden: true,
        },
      },
    },
  },
  show: {
    fields: ["*"],
  },
};
