"use client";
'use strict';

var React = require('react');
var utils = require('@hanzo/ui/lib/utils');
var jsxRuntime = require('react/jsx-runtime');

function _interopNamespace(e) {
  if (e && e.__esModule) return e;
  var n = Object.create(null);
  if (e) {
    Object.keys(e).forEach(function (k) {
      if (k !== 'default') {
        var d = Object.getOwnPropertyDescriptor(e, k);
        Object.defineProperty(n, k, d.get ? d : {
          enumerable: true,
          get: function () { return e[k]; }
        });
      }
    });
  }
  n.default = e;
  return Object.freeze(n);
}

var React__namespace = /*#__PURE__*/_interopNamespace(React);

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

exports.Gantt = Gantt;
