import React, { useState } from "react";

import { ContribComponent } from "../../../types";
import { ArticlePricingCard } from "../components/ArticlePricingCard";
import { ArticlePriceSerializer } from "../types/contrib";

const ArticlePricing: ContribComponent<ArticlePriceSerializer[]> = ({ data, params }) => {
  const { code } = params as { code: string };
  const [prices, setPrices] = useState(data);

  return <ArticlePricingCard code={code} prices={prices} setPrices={setPrices} />;
};

export default ArticlePricing;
