"use client";
import * as React from 'react';
import { cn } from '@hanzo/ui/lib/utils';
import { jsx, jsxs } from 'react/jsx-runtime';

var Gantt = React.forwardRef(
  ({ className, tasks = [], ...props }, ref) => {
    return /* @__PURE__ */ jsx(
      "div",
      {
        ref,
        className: cn(
          "rounded-lg border bg-card text-card-foreground shadow-sm",
          className
        ),
        ...props,
        children: /* @__PURE__ */ jsx("div", { className: "p-6", children: /* @__PURE__ */ jsx("div", { className: "space-y-4", children: tasks.length === 0 ? /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center p-8", children: /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: "No tasks available. Add tasks to display Gantt chart." }) }) : tasks.map((task) => /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
          /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between text-sm", children: [
            /* @__PURE__ */ jsx("span", { className: "font-medium", children: task.name }),
            /* @__PURE__ */ jsxs("span", { className: "text-muted-foreground", children: [
              task.progress ?? 0,
              "%"
            ] })
          ] }),
          /* @__PURE__ */ jsx("div", { className: "h-8 rounded-md bg-muted", children: /* @__PURE__ */ jsx(
            "div",
            {
              className: "h-full rounded-md bg-primary",
              style: { width: `${task.progress ?? 0}%` }
            }
          ) }),
          /* @__PURE__ */ jsxs("div", { className: "flex justify-between text-xs text-muted-foreground", children: [
            /* @__PURE__ */ jsx("span", { children: task.start.toLocaleDateString() }),
            /* @__PURE__ */ jsx("span", { children: task.end.toLocaleDateString() })
          ] })
        ] }, task.id)) }) })
      }
    );
  }
);
Gantt.displayName = "Gantt";

export { Gantt };
