2025-03-26 13:00:33 +00:00
|
|
|
import React, { useEffect, useState } from "react";
|
2025-03-26 05:48:23 +00:00
|
|
|
import RenameInput from "../../../ui/inputs/RenameInput";
|
|
|
|
import Vector3Input from "../customInput/Vector3Input";
|
2025-03-26 13:00:33 +00:00
|
|
|
import { useSelectedZoneStore } from "../../../../store/useZoneStore";
|
2025-03-26 05:48:23 +00:00
|
|
|
|
2025-03-26 06:52:04 +00:00
|
|
|
const ZoneProperties: React.FC = () => {
|
|
|
|
const [Edit, setEdit] = useState(false);
|
2025-03-26 13:00:33 +00:00
|
|
|
const { selectedZone, setSelectedZone } = useSelectedZoneStore();
|
2025-03-26 06:52:04 +00:00
|
|
|
|
|
|
|
function handleSetView() {
|
|
|
|
setEdit(false);
|
|
|
|
}
|
|
|
|
|
|
|
|
function handleEditView() {
|
|
|
|
if (Edit) {
|
|
|
|
setEdit(false);
|
|
|
|
} else {
|
|
|
|
setEdit(true);
|
|
|
|
}
|
|
|
|
}
|
2025-03-26 13:00:33 +00:00
|
|
|
useEffect(() => {
|
|
|
|
|
|
|
|
console.log(' selectedZone.zoneName: ', selectedZone.zoneName);
|
|
|
|
}, [selectedZone])
|
2025-03-26 06:52:04 +00:00
|
|
|
|
2025-03-26 05:48:23 +00:00
|
|
|
return (
|
|
|
|
<div className="zone-properties-container">
|
|
|
|
<div className="header">
|
2025-03-26 13:00:33 +00:00
|
|
|
<RenameInput value={selectedZone.zoneName ? selectedZone.zoneName : ""} />
|
2025-03-26 06:52:04 +00:00
|
|
|
<div className="button" onClick={handleEditView}>
|
|
|
|
{Edit ? "Cancel" : "Edit"}
|
|
|
|
</div>
|
2025-03-26 05:48:23 +00:00
|
|
|
</div>
|
2025-03-26 13:00:33 +00:00
|
|
|
<Vector3Input onChange={() => { }} header="Viewport Target" />
|
|
|
|
<Vector3Input onChange={() => { }} header="Viewport Position" />
|
2025-03-26 06:52:04 +00:00
|
|
|
{Edit && (
|
|
|
|
<div className="button-save" onClick={handleSetView}>
|
|
|
|
Set View
|
|
|
|
</div>
|
|
|
|
)}
|
2025-03-26 05:48:23 +00:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default ZoneProperties;
|