// src/components/FlyerCountDisplay.tsx import React from 'react'; import { ErrorDisplay } from './ErrorDisplay'; import { useFlyers } from '../hooks/useFlyers'; /** * A simple component that displays the number of flyers available. * It demonstrates consuming the useFlyers hook for its state. */ export const FlyerCountDisplay: React.FC = () => { const { flyers, isLoadingFlyers: isLoading, flyersError: error } = useFlyers(); if (isLoading) { return
Loading...
; } if (error) { return ; } return
Number of flyers: {flyers.length}
; };