// Example E — the SW popup frame with project content (no Header). SWPopup keeps the property window design;
// children are free: SWPopupSection / SWPopupRow rows with SWHeaderInput, and an existing SW dropdown.
import { useId, useState } from "react"
import { SWHeaderLayerMenu, SWHeaderInput, SWPopup, SWPopupRow, SWPopupSection, SWTheme } from "@hm-design/sw"
import { layers } from "./sample-data"
export function ExampleECustomPopup({ onEvent }: { onEvent?: (name: string) => void }) {
const [open, setOpen] = useState(true)
const nameId = useId()
const [name, setName] = useState("평면도-01")
const [scale, setScale] = useState("100")
const [x, setX] = useState("1200.5")
const [activeLayerId, setActiveLayerId] = useState("0")
if (!open) return
return (
{ setOpen(false); onEvent?.("popup:close") }}>
{ setName(next); onEvent?.(`name:${next}`) }} />
{ setScale(next); onEvent?.(`scale:${next}`) }} />
{ setX(next); onEvent?.(`x:${next}`) }} />
{/* Inside a popup the dropdown opens as a fixed overlay, so the scrolling body never clips it. */}
{ setActiveLayerId(layer.id); onEvent?.(`layer:${layer.id}`) }} />
)
}