"use client";

import { useState } from "react";

interface CompletePrintProps {
  onClick: () => void;
}

const CompletePrint: React.FC<CompletePrintProps> = ({ onClick }) => {
  const [isComplete, setComplete] = useState(false);
  return (
    <button
      onClick={() => {
        setComplete(true);
        onClick();
      }}
      className={
        isComplete
          ? "rounded-md border px-2 py-1 text-xs border-green-300 text-green-600 hover:bg-green-200 dark:border-green-600 dark:text-green-300 dark:hover:bg-green-600 transition"
          : "rounded-md border px-2 py-1 text-xs border-slate-300 text-slate-600 hover:bg-slate-200 dark:border-slate-600 dark:text-slate-300 dark:hover:bg-slate-600 transition"
      }
      disabled={isComplete}
    >
      تکمیل
    </button>
  );
};

export default CompletePrint;
