import type { FilterGroup } from "@fn-sphere/core"; import { Fragment } from "react"; import { useView } from "../theme/hooks.js"; import type { CommonProps } from "./types.js"; export type FilterGroupProps = { rule: FilterGroup; } & CommonProps; export const FilterGroupView = ({ rule, ...props }: FilterGroupProps) => { const { FilterGroupContainer, SingleFilter: FilterRuleView, RuleJoiner, } = useView("templates"); return ( {rule.conditions.map((childRule, groupIdx) => { return ( {groupIdx > 0 && ( )} {childRule.type === "Filter" ? ( ) : ( )} ); })} ); }; FilterGroupView.displayName = "FilterGroupView";