import type { FormattedAutoQuote } from "@hooks/apis/common/quote/types";
import { SendNativeTransaction } from "./SendNativeTransaction";
import { SignOrder } from "./SignOrder";

export const AutoFlow = ({
	data,
	disabled = false,
}: {
	data: FormattedAutoQuote;
	disabled?: boolean;
}) => {
	if (!data) return;

	const { userOp } = data;
	if (userOp === "tx")
		return <SendNativeTransaction quoteData={data} disabled={disabled} />;

	return <SignOrder quoteData={data} disabled={disabled} />;
};
