import payloadHeader from "./payloadHeader"

export default (props = {}) => {
  const header = payloadHeader({
    ...props,
    ...{ _type: "tag" },
  })

  return {
    ...header,
    _meta: {
      childCount: props?._meta?.childCount || props?.childCount || 0,
    },
    _source: {
      _id: props._id || null,
      project: props.project || null,
      title: props.title || null,
      type: props.type || "user", // default, milestone, status, etc.
      locked: props.locked || false,
      order: props.order || 0,
      tags: props.tags || [],
    },
  }
}
