chore: cleanup

This commit is contained in:
amhsirak
2025-01-25 16:18:10 +05:30
parent 3918a6e558
commit 8e5181ec46

View File

@@ -318,22 +318,18 @@ export const RobotEditModal = ({ isOpen, handleStart, handleClose, initialSettin
return ( return (
<TextField <TextField
key={selector} key={selector}
// The type changes based on visibility state
type={isVisible ? 'text' : 'password'} type={isVisible ? 'text' : 'password'}
// label={`Text ${selector}`}
label={headerText === 'Other' ? `${`Input`} ${index + 1}` : headerText} label={headerText === 'Other' ? `${`Input`} ${index + 1}` : headerText}
value={credentials[selector]?.value || ''} value={credentials[selector]?.value || ''}
onChange={(e) => handleCredentialChange(selector, e.target.value)} onChange={(e) => handleCredentialChange(selector, e.target.value)}
style={{ marginBottom: '20px' }} style={{ marginBottom: '20px' }}
InputProps={{ InputProps={{
// Now showing visibility toggle for all fields
endAdornment: ( endAdornment: (
<InputAdornment position="end"> <InputAdornment position="end">
<IconButton <IconButton
aria-label="Show input" aria-label="Show input"
onClick={() => handleClickShowPassword(selector)} onClick={() => handleClickShowPassword(selector)}
edge="end" edge="end"
// Optional: disable if field is empty
disabled={!credentials[selector]?.value} disabled={!credentials[selector]?.value}
> >
{isVisible ? <Visibility /> : <VisibilityOff />} {isVisible ? <Visibility /> : <VisibilityOff />}