import React from "react";
import { useParams, useNavigate } from "react-router-dom";
import { DraftEditor } from "@/shared/features/invoices/DraftEditor";

export const InvoiceDraftPage: React.FC = () => {
  const { id: draftId } = useParams<{ id: string }>();
  const navigate = useNavigate();

  if (!draftId) {
    return null;
  }

  return (
    <div style={{ height: "100vh", display: "flex", flexDirection: "column" }}>
      <DraftEditor draftId={draftId} onBack={() => navigate("/invoices")} />
    </div>
  );
};
