"use client";

import { Printer } from "lucide-react";
import { Button } from "@/components/ui/button";

export function PrintButton({ recipeId }: { recipeId: string }) {
  function handlePrint() {
    const win = window.open(`/recipes/${recipeId}/print`, "_blank", "width=800,height=900");
    win?.focus();
  }

  return (
    <Button variant="outline" size="sm" onClick={handlePrint}>
      <Printer className="h-4 w-4" />
      Print
    </Button>
  );
}
