Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function EditableCell({ record, property }) {
const { acquired } = usePermissionModel()
const [editing, setEditing] = useState(false)
const { modifyHost } = useHostsModel()
const ref = useClickAway(() => {
setEditing(false)
})
if (!editing) {
return (
<div style="{{"> {
acquired && setEditing(true)
}}
>
{record[property]}
</div>
)
}