'use client';

import {Heading, Text} from '@astryxdesign/core/Text';
import {BarChartView} from '@/shared/components/charts/BarChartView';
import {ORDERS_TREND_DATA} from '../../services/commerceService';

export function OrdersChart() {
  return (
    <div className="rounded-xl border border-border bg-card p-4 space-y-3 overflow-hidden shadow-sm">
      <div className="flex items-center justify-between">
        <div>
          <Heading level={4} className="text-base font-bold text-white">
            Orders Volume Trend
          </Heading>
          <Text size="sm" color="secondary">
            Completed order count grouped by hourly buckets
          </Text>
        </div>
        <span className="text-xs font-bold text-white bg-zinc-800 px-2.5 py-1 rounded-full border border-zinc-700">
          1,284 Orders Today
        </span>
      </div>

      <div className="h-64 w-full pt-2">
        <BarChartView
          data={ORDERS_TREND_DATA}
          xKey="time"
          series={[{key: 'Orders', label: 'Completed Orders'}]}
          height="100%"
        />
      </div>
    </div>
  );
}
