import { useEffect, useState } from 'react';
import userService from '../services/user.service';

export default function BoardAdmin() {
  const [content, setContent] = useState('');

  useEffect(() => {
    userService.getAdminBoard().then(
      (res) => setContent(String(res.data ?? '')),
      (error: unknown) => {
        setContent(error instanceof Error ? error.message : String(error));
      },
    );
  }, []);

  return (
    <div className="container">
      <header className="jumbotron">
        <h3>{content}</h3>
      </header>
    </div>
  );
}
