5
import { useState } from 'react';
import { Input } from "/components/ui/input";
import { Button } from "/components/ui/button";
import { Textarea } from "/components/ui/textarea";
export default function RephraseArticle() {
  const [articleLink, setArticleLink] = useState('');
  const [rephrasedArticle, setRephrasedArticle] = useState('');
  const rephraseArticle = async () => {
    if (!articleLink) return;
    try {
      const response = await fetch('/api/rephrase-article', {
        method: 'POST',
        headers: {
          'Content-Type': 'application/json',
        },
        body: JSON.stringify({ articleLink }),
      });
      const data = await response.json();
      setRephrasedArticle(data.rephrasedArticle);
    } catch (error) {
      console.error(error);
    }
  };
  return (
    
       setArticleLink(e.target.value)}
        placeholder="Enter article link"
      />
      
      
    
  );
}
تعليقات
إرسال تعليق