- >
- )}
- {local.status === "ready" && (
-
- {filtered.map((item, idx) => {
- let is_active = false;
- if (typeof value === "object") {
- const c = (value as any)?.connect;
- if (c) {
- is_active = item.value === c[local.pk_field];
- }
- } else {
- is_active = item.value === value;
- }
-
- return (
-
0 && "c-border-t",
- idx === 0 && "c-rounded-t-sm",
- idx === local.list.length - 1 && "c-rounded-b-sm"
- )}
- onClick={() => {
- if (form) {
- local.open = false;
- form.hook.setValue(name, {
- connect: { [local.pk_field]: item.value },
- });
- form.render();
- }
- }}
- >
- {item.label || "-"}
-
- );
- })}
-