// app_top_bar.dart — 页面顶栏(品牌锁版 + 可选右侧状态)
import 'package:flutter/material.dart';

import '../pangolin_theme.dart';
import 'pangolin_logo.dart';

class AppTopBar extends StatelessWidget {
  const AppTopBar({super.key, required this.brand, this.trailing});
  final String brand;
  final Widget? trailing;

  @override
  Widget build(BuildContext context) {
    return Padding(
      padding: const EdgeInsets.fromLTRB(20, 6, 20, 14),
      child: Row(children: [
        PangolinBrandLockup(brand: brand, markSize: 24),
        const Spacer(),
        if (trailing != null) trailing!,
      ]),
    );
  }
}

/// 标题行(节点/统计/账户页用)。
class PageTitle extends StatelessWidget {
  const PageTitle({super.key, required this.title});
  final String title;
  @override
  Widget build(BuildContext context) {
    final c = context.pangolin;
    return Padding(
      padding: const EdgeInsets.fromLTRB(20, 0, 20, 12),
      child: Text(title, style: PangolinText.h2.copyWith(color: c.fg1)),
    );
  }
}
