Skip to content

Commit

Permalink
Remove useCallback
Browse files Browse the repository at this point in the history
  • Loading branch information
ilong4rennes committed Dec 13, 2024
1 parent ef57643 commit 577b374
Showing 1 changed file with 23 additions and 26 deletions.
49 changes: 23 additions & 26 deletions admin/src/Components/ProductForm.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useCallback, useEffect, useState } from "react";
import React, { useEffect, useState } from "react";
import ReactSelect from "react-select";
import ProductAction, { ACTION_TYPES } from "../Models/ProductAction";
import CheckboxInput from "./CheckboxInput";
Expand Down Expand Up @@ -62,32 +62,29 @@ const ProductForm = ({ product, onDelete, onSave }) => {
product.removeAction(action);
};

const renderAction = useCallback(
(action) => (
<div key={action.action_type} className="form-row uk-grid">
<div className="uk-with-1-6">{action.action_type}</div>
<div className="uk-with-1-6">
<strong>Värde</strong>
</div>
<div className="uk-with-3-6">
<TextInput
model={action}
label={false}
formrow={false}
name={"value"}
/>
</div>
<div className="uk-with-1-6">
<a
className="uk-button uk-button-danger"
onClick={() => handleRemoveAction(action)}
>
<i className="uk-icon-trash-o" />
</a>
</div>
const renderAction = (action) => (
<div key={action.action_type} className="form-row uk-grid">
<div className="uk-with-1-6">{action.action_type}</div>
<div className="uk-with-1-6">
<strong>Värde</strong>
</div>
),
[],
<div className="uk-with-3-6">
<TextInput
model={action}
label={false}
formrow={false}
name={"value"}
/>
</div>
<div className="uk-with-1-6">
<a
className="uk-button uk-button-danger"
onClick={() => handleRemoveAction(action)}
>
<i className="uk-icon-trash-o" />
</a>
</div>
</div>
);

const imageSrc = (o) => `data:${o.type};base64, ` + o.data;
Expand Down

0 comments on commit 577b374

Please sign in to comment.