import React from 'react'
import figma from '@figma/code-connect'
import { ListGrid } from '.'

const LIST_GRID = '<PLANVIEW_DESIGN_SYSTEM_FIGMA_DOCUMENT>?node-id=15487:63016'

figma.connect(ListGrid, LIST_GRID, {
    variant: { Variant: 'Flat list' },
    props: {
        selectionMode: figma.enum('Multi select', {
            Off: undefined,
            On: 'multi',
        }),
    },
    example: ({ selectionMode }) => (
        <ListGrid
            columns={[{ id: 'name', label: 'Name' }]}
            rows={[]}
            selectionMode={selectionMode}
        />
    ),
})

figma.connect(ListGrid, LIST_GRID, {
    variant: { Variant: 'Tree list' },
    props: {
        selectionMode: figma.enum('Multi select', {
            Off: undefined,
            On: 'multi',
        }),
    },
    example: ({ selectionMode }) => (
        <ListGrid
            columns={[{ id: 'name', label: 'Name', tree: true }]}
            rows={[]}
            selectionMode={selectionMode}
        />
    ),
})
