"use client";
'use strict';

const jsxRuntime = require('react/jsx-runtime');
const React = require('react');
const LucideIcons = require('lucide-react');
const button = require('../../../../../../../ui/src/components/button.cjs');
const badge = require('../../../../../../../ui/src/components/badge.cjs');
const kanban = require('../../../../../../../ui/src/components/kanban.cjs');
const dropdownMenu = require('../../../../../../../ui/src/components/dropdown-menu.cjs');
const taskCard = require('./task-card.cjs');

function ColumnContentComponent({
  column,
  onAddTask,
  onEditTask,
  onEditColumn,
  onDeleteColumn
}) {
  const hasTasks = column.tasks && column.tasks.length > 0;
  return /* @__PURE__ */ jsxRuntime.jsxs(kanban.KanbanColumn, { value: column.id, children: [
    /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center", children: [
      /* @__PURE__ */ jsxRuntime.jsx(kanban.KanbanColumnHandle, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(button.Button, { variant: "ghost", size: "icon", children: /* @__PURE__ */ jsxRuntime.jsx(LucideIcons.GripVertical, { className: "h-4 w-4" }) }) }),
      /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 flex-1", children: [
        /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-bold text-lg line-clamp-1 flex-1 text-left", children: column.title }),
        /* @__PURE__ */ jsxRuntime.jsx(badge.Badge, { variant: "outline", className: "pointer-events-none rounded-sm", children: column.tasks?.length || 0 })
      ] }),
      /* @__PURE__ */ jsxRuntime.jsxs(dropdownMenu.DropdownMenu, { children: [
        /* @__PURE__ */ jsxRuntime.jsx(dropdownMenu.DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(button.Button, { variant: "ghost", size: "icon", children: /* @__PURE__ */ jsxRuntime.jsx(LucideIcons.MoreVertical, { className: "h-4 w-4" }) }) }),
        /* @__PURE__ */ jsxRuntime.jsxs(dropdownMenu.DropdownMenuContent, { align: "end", children: [
          /* @__PURE__ */ jsxRuntime.jsxs(dropdownMenu.DropdownMenuItem, { onClick: onEditColumn, children: [
            /* @__PURE__ */ jsxRuntime.jsx(LucideIcons.Pencil, { className: "mr-2 h-4 w-4" }),
            "Edit Column"
          ] }),
          /* @__PURE__ */ jsxRuntime.jsxs(dropdownMenu.DropdownMenuItem, { onClick: onAddTask, children: [
            /* @__PURE__ */ jsxRuntime.jsx(LucideIcons.Plus, { className: "mr-2 h-4 w-4" }),
            "Add Task"
          ] }),
          /* @__PURE__ */ jsxRuntime.jsx(dropdownMenu.DropdownMenuSeparator, {}),
          /* @__PURE__ */ jsxRuntime.jsxs(
            dropdownMenu.DropdownMenuItem,
            {
              onClick: onDeleteColumn,
              className: "text-red-600 focus:text-red-600",
              children: [
                /* @__PURE__ */ jsxRuntime.jsx(LucideIcons.Trash2, { className: "mr-2 h-4 w-4" }),
                "Delete Column"
              ]
            }
          )
        ] })
      ] })
    ] }),
    /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-0.5 space-y-2", children: hasTasks ? column.tasks.map((task) => /* @__PURE__ */ jsxRuntime.jsx(
      taskCard.TaskCard,
      {
        task,
        onClick: () => onEditTask(task.id)
      },
      task.id
    )) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center justify-center py-1 md:py-8 text-center", children: [
      /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-full bg-muted p-4 mb-3 hidden md:block", children: /* @__PURE__ */ jsxRuntime.jsx(LucideIcons.Plus, { className: "h-5 w-5 text-muted-foreground" }) }),
      /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1 mb-2 md:space-y-2 md:mb-4", children: [
        /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: "No tasks yet" }),
        /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: "Add a task to get started" })
      ] }),
      /* @__PURE__ */ jsxRuntime.jsxs(button.Button, { onClick: onAddTask, size: "sm", children: [
        /* @__PURE__ */ jsxRuntime.jsx(LucideIcons.Plus, { className: "mr-2 h-4 w-4" }),
        "Add Task"
      ] })
    ] }) })
  ] }, column.id);
}
const ColumnContent = React.memo(ColumnContentComponent);

exports.ColumnContent = ColumnContent;
