import { DefaultChild } from "@brevity-builder/models";

export default {
  name: "Switch Container",
  acceptsChildren: false,
  category: "Container",
  optionalLayers: [
    {
      id: "Fallback",
      name: "Fallback",
      acceptsChildren: true,
      props: [],
      additionalStates: [],
      defaultStyles: {},
    },
    {
      id: "Content",
      name: "Content",
      acceptsChildren: true,
      props: [],
      additionalStates: [],
      defaultStyles: {},
    },
  ],
  props: [
    {
      label: "Condition",
      name: "resolve",
      type: { kind: "value", isDynamic: true },
      required: true,
      default: false,
      placeholder: "Enter a condition",
      help: "The content child of this component will show when condition is truthy or it will show the fallback child",
    },
  ],
  events: [],
  defaultStyles: {},
  sources: [],
  defaultChildren: [
    {
      kind: "SwitchContainer$Brevity.Content",
      props: {},
      styleProps: {},
      children: [],
    },
    {
      kind: "SwitchContainer$Brevity.Fallback",
      props: {},
      styleProps: {},
      children: [],
    },
  ] satisfies DefaultChild[],
} as const;
