import 'package:flutter/material.dart';

import '../../../routing/app_routes.dart';
import 'widgets/ticker_page_body.dart';

/// Standalone detail screen for a single ticker page, used for deep links from
/// outside the ticker module ([AppRoutes.openTickerPage]). Inside the ticker
/// module itself pages render in-place via [TickerPageBody]. Internal content
/// links keep the classic push behaviour here through [AppRoutes.openTickerLink].
class TickerPageView extends StatelessWidget {
  final String slug;
  final String? title;

  const TickerPageView({super.key, required this.slug, this.title});

  @override
  Widget build(BuildContext context) => Scaffold(
    appBar: AppBar(title: Text(title ?? 'Ticker')),
    body: TickerPageBody(
      slug: slug,
      onLinkTap: (href) => AppRoutes.openTickerLink(context, href),
      onRedirect: () => Navigator.of(context).maybePop(),
    ),
  );
}
