#nullable enable
using System;
using UnityEngine;
namespace SHI.modal
{
///
/// 차트 패널: 간트 데이터 바인딩/선택 동기화용 경량 래퍼.
/// 실제 UI Toolkit 간트 구현 전까지 스텁 동작을 수행합니다.
///
public class ModelDetailChartView : MonoBehaviour
{
public Action? OnRowClickedByKey;
public Action? OnRowClicked; // backward compat
private GanttChartData? _data;
public void LoadData(GanttChartData data)
{
_data = data;
Debug.Log($"ModelDetailChartView.LoadData: segments={data?.Segments?.Count ??0}");
}
public void SelectByItemKey(string key)
{
if (_data == null) { Debug.Log("ChartView.SelectByItemKey: no data"); return; }
Debug.Log($"Chart highlight by key: {key}");
}
public void SelectByItemId(Guid id)
{
if (_data == null) { Debug.Log("ChartView.SelectByItemId: no data"); return; }
Debug.Log($"Chart highlight by id: {id}");
}
// Simulate UI callbacks
public void SimulateRowClickKey(string key)
{
OnRowClickedByKey?.Invoke(key);
}
public void SimulateRowClick(string id)
{
if (Guid.TryParse(id, out var guid)) OnRowClicked?.Invoke(guid);
}
public void Dispose() { _data = null; }
}
}