import { Editor, createShapeId } from "@tldraw/tldraw"

// Test function to find the correct tldraw v3 properties
export function testTldrawProps(editor: Editor) {
  try {
    // Test 1: Basic rectangle with minimal properties
    const rectId1 = createShapeId()
    editor.createShape({
      id: rectId1,
      type: "geo",
      x: 100,
      y: 100,
      props: {
        w: 100,
        h: 100,
        geo: "rectangle",
      },
    })
    console.log("✅ Basic rectangle created successfully")

    // Test 2: Rectangle with fill
    const rectId2 = createShapeId()
    editor.createShape({
      id: rectId2,
      type: "geo",
      x: 250,
      y: 100,
      props: {
        w: 100,
        h: 100,
        geo: "rectangle",
        fill: "none",
      },
    })
    console.log("✅ Rectangle with fill created successfully")

    // Test 3: Rectangle with color
    const rectId3 = createShapeId()
    editor.createShape({
      id: rectId3,
      type: "geo",
      x: 400,
      y: 100,
      props: {
        w: 100,
        h: 100,
        geo: "rectangle",
        fill: "none",
        color: "black",
      },
    })
    console.log("✅ Rectangle with color created successfully")

    // Test 4: Text with minimal properties
    const textId1 = createShapeId()
    editor.createShape({
      id: textId1,
      type: "text",
      x: 100,
      y: 250,
      props: {
        text: "Test Text",
      },
    })
    console.log("✅ Basic text created successfully")

    // Test 5: Text with size
    const textId2 = createShapeId()
    editor.createShape({
      id: textId2,
      type: "text",
      x: 250,
      y: 250,
      props: {
        text: "Test Text",
        w: 100,
        h: 50,
      },
    })
    console.log("✅ Text with size created successfully")

    // Test 6: Text with font properties
    const textId3 = createShapeId()
    editor.createShape({
      id: textId3,
      type: "text",
      x: 400,
      y: 250,
      props: {
        text: "Test Text",
        w: 100,
        h: 50,
        fontSize: 16,
        color: "black",
      },
    })
    console.log("✅ Text with font properties created successfully")

  } catch (error) {
    console.error("❌ Error creating shape:", error)
  }
}
