"use client";
import { jsx } from 'react/jsx-runtime';
import { usePluginOverrides, useBasePath } from '@btst/stack/context';
import { DefaultLink } from './defaults.mjs';
import { Badge } from '../../../../../../../ui/src/components/badge.mjs';
import { useSuspenseTags } from '../../hooks/blog-hooks.mjs';

function TagsList() {
  const { tags } = useSuspenseTags();
  const { Link } = usePluginOverrides("blog", {
    Link: DefaultLink
  });
  const basePath = useBasePath();
  if (!tags || tags.length === 0) {
    return null;
  }
  return /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2 justify-center", children: tags.map((tag) => /* @__PURE__ */ jsx(Link, { href: `${basePath}/blog/tag/${tag.slug}`, children: /* @__PURE__ */ jsx(Badge, { variant: "secondary", className: "text-xs", children: tag.name }) }, tag.id)) });
}

export { TagsList };
