Refactor template deletion and widget styling; enhance camera model visibility logic

This commit is contained in:
2025-04-11 11:27:51 +05:30
parent 8ed035b969
commit dd91620a5c
3 changed files with 205 additions and 164 deletions

View File

@@ -26,9 +26,14 @@ const Templates = () => {
templateData();
}, []);
const handleDeleteTemplate = async (id: string) => {
const handleDeleteTemplate = async (
e: React.MouseEvent<HTMLButtonElement>,
id: string
) => {
try {
e.stopPropagation();
const email = localStorage.getItem("email") || "";
const organization = email?.split("@")[1]?.split(".")[0];
let deleteTemplate = {
organization: organization,
@@ -49,7 +54,6 @@ const Templates = () => {
const handleLoadTemplate = async (template: any) => {
try {
if (selectedZone.zoneName === "") return;
const email = localStorage.getItem("email") || "";
const organization = email?.split("@")[1]?.split(".")[0];
@@ -108,7 +112,7 @@ const Templates = () => {
<RenameInput value={`Template ${index + 1}`} />
</div>
<button
onClick={() => handleDeleteTemplate(template.id)}
onClick={(e) => handleDeleteTemplate(e, template.id)}
className="delete-button"
aria-label="Delete template"
>

View File

@@ -33,7 +33,7 @@ const WidgetsFloating = () => {
};
return (
<div className="floatingWidgets-wrapper">
<div className="floatingWidgets-wrapper widgets-wrapper">
{/* {widgets.map((widget) => (
<div
key={widget.id}