import { useEffect } from 'react';
import { useNavigate, useSearchParams } from 'react-router-dom';
import PageHeader from '@dukang/shared-ui/PageHeader';
import ActivityPosterPicker from '../components/ActivityPosterPicker';
import { usePartnerPageView } from '../lib/usePageView';

export default function ActivityPostersPage() {
  usePartnerPageView('partner_activity_posters_view');
  const navigate = useNavigate();
  const [searchParams] = useSearchParams();
  const initialId = searchParams.get('id');

  useEffect(() => {
    document.title = '活动图';
  }, []);

  return (
    <div>
      <PageHeader title="活动图" onBack={() => navigate(-1)} />
      <div style={{ padding: 16 }}>
        <ActivityPosterPicker initialId={initialId} />
      </div>
    </div>
  );
}
