import { Snippet } from '@alilc/lowcode-types';

export const snippetsCard: Snippet[] = [
  {
    title: '指标卡片',
    screenshot:
      'https://img.alicdn.com/imgextra/i4/O1CN01qjZnGj1OW8lpLCQqm_!!6000000001712-55-tps-56-56.svg',
    schema: {
      componentName: 'StatisticCard',
      props: {
        title: '指标标题',
        headerBordered: false,
        statistic: {
          title: '总流量(人次)',
          value: 601986875,
        },
      },
    },
  },
];

export const snippetsGroup: Snippet[] = [
  {
    title: '指标卡片组',
    screenshot:
      'https://img.alicdn.com/imgextra/i4/O1CN01qjZnGj1OW8lpLCQqm_!!6000000001712-55-tps-56-56.svg',
    schema: {
      componentName: 'StatisticCard.Group',
      props: {
        direction: 'row',
      },
      children: [
        {
          componentName: 'StatisticCard',
          props: {
            title: '指标标题',
            headerBordered: false,
            statistic: {
              value: 601986875,
              prefix: '¥',
              description: {
                type: 'JSSlot',
                value: [
                  {
                    componentName: 'Space',
                    props: {},
                    children: [
                      {
                        componentName: 'ProStatistic',
                        props: {
                          title: '实际完成度',
                          value: '82.3%',
                        },
                      },
                    ],
                  },
                ],
              },
            },
          },
        },
        {
          componentName: 'StatisticCard',
          props: {
            title: '指标标题1',
            headerBordered: false,
            statistic: {
              title: '总流量(人次)',
              value: 601986875,
            },
            chart: {
              type: 'JSSlot',
              value: [
                {
                  componentName: 'LineChart',
                  props: {
                    data: [
                      { year: '1951 年', sales: 38 },
                      { year: '1952 年', sales: 52 },
                      { year: '1956 年', sales: 61 },
                      { year: '1957 年', sales: 45 },
                      { year: '1958 年', sales: 48 },
                      { year: '1959 年', sales: 38 },
                      { year: '1960 年', sales: 38 },
                      { year: '1962 年', sales: 38 },
                    ],
                    xField: 'year',
                    yField: 'sales',
                    color: '#0079f2',
                    label: {
                      visible: true,
                    },
                  },
                },
              ],
            },
          },
        },
      ],
    },
  },
];
