// @bun
// src/presentation/features/molecules/FeatureFilters/FeatureFilters.tsx
import { Button, Input } from "@contractspec/lib.design-system";
import { VStack, HStack } from "@contractspec/lib.ui-kit-web/ui/stack";
import { cn } from "@contractspec/lib.ui-kit-web/ui/utils";
import { jsx, jsxs } from "react/jsx-runtime";
"use client";
function FeatureFiltersBar({
  uniqueTags,
  uniqueStabilities,
  filters,
  setSearch,
  toggleTag,
  toggleStability,
  clearFilters,
  hasActiveFilters,
  className
}) {
  return /* @__PURE__ */ jsxs(VStack, {
    gap: "md",
    className: cn("w-full", className),
    children: [
      /* @__PURE__ */ jsxs(HStack, {
        gap: "md",
        justify: "between",
        className: "w-full",
        children: [
          /* @__PURE__ */ jsx(Input, {
            placeholder: "Search features...",
            value: filters.search,
            onChange: (e) => setSearch(e.target.value),
            className: "max-w-md",
            "aria-label": "Search features"
          }),
          hasActiveFilters && /* @__PURE__ */ jsx(Button, {
            variant: "ghost",
            size: "sm",
            onClick: clearFilters,
            children: "Clear filters"
          })
        ]
      }),
      uniqueStabilities.length > 0 && /* @__PURE__ */ jsxs(HStack, {
        gap: "xs",
        wrap: "wrap",
        children: [
          /* @__PURE__ */ jsx("span", {
            className: "text-muted-foreground text-sm",
            children: "Stability:"
          }),
          uniqueStabilities.map((stability) => /* @__PURE__ */ jsx(Button, {
            variant: filters.stability.includes(stability) ? "default" : "outline",
            size: "sm",
            onClick: () => toggleStability(stability),
            "aria-pressed": filters.stability.includes(stability),
            children: stability
          }, stability))
        ]
      }),
      uniqueTags.length > 0 && /* @__PURE__ */ jsxs(HStack, {
        gap: "xs",
        wrap: "wrap",
        children: [
          /* @__PURE__ */ jsx("span", {
            className: "text-muted-foreground text-sm",
            children: "Tags:"
          }),
          uniqueTags.slice(0, 10).map((tag) => /* @__PURE__ */ jsxs(Button, {
            variant: filters.tags.includes(tag) ? "default" : "outline",
            size: "sm",
            onClick: () => toggleTag(tag),
            "aria-pressed": filters.tags.includes(tag),
            children: [
              "#",
              tag
            ]
          }, tag)),
          uniqueTags.length > 10 && /* @__PURE__ */ jsxs("span", {
            className: "text-muted-foreground text-sm",
            children: [
              "+",
              uniqueTags.length - 10,
              " more"
            ]
          })
        ]
      })
    ]
  });
}
export {
  FeatureFiltersBar
};
