correct spelling mis.
This commit is contained in:
parent
e5fa6bb6ea
commit
f7975b4fb2
@ -6,7 +6,7 @@ const OPERATORS = {
|
|||||||
{ key: "neq", label: "Not Equal" },
|
{ key: "neq", label: "Not Equal" },
|
||||||
{ key: "gt", label: "Greater Than" },
|
{ key: "gt", label: "Greater Than" },
|
||||||
{ key: "gte", label: "Greater or Equal" },
|
{ key: "gte", label: "Greater or Equal" },
|
||||||
{ key: "less than", label: "Less Than" },
|
{ key: "lt", label: "Less Than" },
|
||||||
{ key: "lte", label: "Less or Equal" },
|
{ key: "lte", label: "Less or Equal" },
|
||||||
{ key: "between", label: "Between" },
|
{ key: "between", label: "Between" },
|
||||||
],
|
],
|
||||||
@ -25,24 +25,24 @@ const OPERATORS = {
|
|||||||
|
|
||||||
// ----------- FILTER UI COMPONENT ----------
|
// ----------- FILTER UI COMPONENT ----------
|
||||||
function AdvanceFilter({ type = "number", onApply, onClear }) {
|
function AdvanceFilter({ type = "number", onApply, onClear }) {
|
||||||
const [operator, setOperator] = useState("");
|
const [operation, setOperator] = useState("");
|
||||||
const [value1, setValue1] = useState("");
|
const [value1, setValue1] = useState("");
|
||||||
const [value2, setValue2] = useState("");
|
const [value2, setValue2] = useState("");
|
||||||
|
|
||||||
const ops = OPERATORS[type];
|
const ops = OPERATORS[type];
|
||||||
|
|
||||||
const apply = () => {
|
const apply = () => {
|
||||||
if (!operator) return;
|
if (!operation) return;
|
||||||
|
|
||||||
if (operator === "between") {
|
if (operation === "between") {
|
||||||
onApply({
|
onApply({
|
||||||
operator,
|
operation,
|
||||||
from: value1,
|
from: value1,
|
||||||
to: value2,
|
to: value2,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
onApply({
|
onApply({
|
||||||
operator,
|
operation,
|
||||||
value: value1,
|
value: value1,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -59,7 +59,7 @@ function AdvanceFilter({ type = "number", onApply, onClear }) {
|
|||||||
<label className="form-label">Condition</label>
|
<label className="form-label">Condition</label>
|
||||||
<select
|
<select
|
||||||
className="form-select form-select-sm"
|
className="form-select form-select-sm"
|
||||||
value={operator}
|
value={operation}
|
||||||
onChange={(e) => setOperator(e.target.value)}
|
onChange={(e) => setOperator(e.target.value)}
|
||||||
>
|
>
|
||||||
<option value="">Select</option>
|
<option value="">Select</option>
|
||||||
@ -72,11 +72,11 @@ function AdvanceFilter({ type = "number", onApply, onClear }) {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Values */}
|
{/* Values */}
|
||||||
{operator && (
|
{operation && (
|
||||||
<div>
|
<div className="text-decoration-none">
|
||||||
<label className="form-label">Value</label>
|
<label className="form-label">Value</label>
|
||||||
|
|
||||||
{operator !== "between" ? (
|
{operation !== "between" ? (
|
||||||
<input
|
<input
|
||||||
type={type === "date" ? "date" : "number"}
|
type={type === "date" ? "date" : "number"}
|
||||||
className="form-control form-control-sm"
|
className="form-control form-control-sm"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user