// SPDX-FileCopyrightText: 2026 FocusFlow contributors
// SPDX-License-Identifier: AGPL-3.0-only

part of '../timeline_axis.dart';

/// Background grid aligned to timeline tick marks.
class TimelineGrid extends StatelessWidget {
  /// Creates a timeline grid for [geometry].
  const TimelineGrid({required this.geometry, this.topInset = 12, super.key});

  /// Geometry used to position grid lines.
  final TimelineGeometry geometry;

  /// Vertical inset before the first timeline tick.
  final double topInset;

  /// Builds the widget subtree for this component.
  /// The method translates the current widget configuration and state into Flutter UI without mutating scheduler domain data.
  @override
  Widget build(BuildContext context) {
    return CustomPaint(
      painter: _TimelineGridPainter(geometry: geometry, topInset: topInset),
      size: Size.infinite,
    );
  }
}
