-
-
- {heading}
-
+
+
{heading}
@@ -542,11 +526,10 @@ const Table = ({ field, t }) => {
const columns =
field?.dropDownOptions?.map((item) => {
-
return {
...item,
name: item.name,
- code: item.code
+ code: item.code,
};
}) || [];
@@ -557,17 +540,81 @@ const Table = ({ field, t }) => {
{
DOSENO: "Dose 1",
STATUS: "Administered",
- COMPLETED_ON: "14 June 2024"
- }
+ COMPLETED_ON: "14 June 2024",
+ },
];
+ return
;
+};
+
+/**
+ * SimpleSearchFilterRow
+ * A minimal row with: [ Search icon + label ] | [ Filter ] | [ Sort icon ]
+ *
+ * Uses your existing
,
, and
components.
+ */
+const SimpleSearchFilterRow = ({
+ components = [],
+ t,
+ // t,
+ // label = "Search",
+ // primaryColor = "currentColor",
+ // size = "20px",
+ // onSearchClick,
+ // onSortClick,
+ // // Pass anything your
needs via this prop
+ // filterProps = {},
+}) => {
+ const formatMap = {};
+ components.forEach((item) => {
+ formatMap[item.jsonPath] = item;
+ });
+
+ const searchIcon = formatMap["searchComplaints"] || { label: "", hidden: true };
+ const filter = formatMap["filter"] || {};
+ const sortIcon = formatMap["sortComplaints"] || {};
+
+ const cellStyle = {
+ minWidth: 0,
+ display: "flex",
+ alignItems: "center",
+ gap: "0.375rem", // tighter gap between icon and label
+ color: "inherit",
+ };
+
return (
-
+
+ {/* Left: Search icon + label */}
+
+ {/* Use currentColor so it won't disappear on white backgrounds */}
+
+ {t?.(searchIcon?.label || "")}
+
+
+ {/* Middle: Filter (full-width inside its cell) */}
+
+
+ {/* Right: Sort icon + label (optional) */}
+
+
+ {sortIcon?.label ? (
+ {t?.(sortIcon?.label || "")}
+ ) : null}
+
+
);
};
@@ -578,5 +625,3 @@ registerComponent("searchByProximity", Toggle);
registerComponent("searchByID", Toggle);
registerComponent("DetailsCard", DetailsCardSection);
registerComponent("Table", Table);
-
-