'use client';

/**
 * HUB-356: the clock button next to a property's label that opens that property's history
 * (`PropertyHistoryDrawer`). Shown on the row's hover (details.css `.crm-prop-history`).
 */
export function PropertyHistoryButton({ label, onClick }: { label: string; onClick: () => void }) {
  return (
    <button
      type="button"
      className="crm-prop-history"
      title={`View ${label} history`}
      aria-label={`View ${label} history`}
      onClick={onClick}
    >
      <svg
        viewBox="0 0 24 24"
        width="12"
        height="12"
        fill="none"
        stroke="currentColor"
        strokeWidth="1.8"
        strokeLinecap="round"
        strokeLinejoin="round"
        aria-hidden
      >
        <path d="M12 8v4l3 3M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" />
        <path d="M3 3v5h5" />
      </svg>
    </button>
  );
}
