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

figma.connect(
    ProductSwitcher,
    '<PLANVIEW_DESIGN_SYSTEM_FIGMA_DOCUMENT>?node-id=7355:20238',
    {
        variant: { Organization: 'Off' },
        example: () => (
            <ProductSwitcher
                products={[
                    {
                        name: 'e1_prm',
                        label: 'Portfolios',
                        url: 'https://us.id.planview.com/api/go/E1_PRM/p-1234',
                        secondaryLabel: 'Sandbox environment',
                    },
                    {
                        name: 'ea',
                        label: 'EA',
                        url: '',
                        secondaryLabel: '',
                        active: true,
                    },
                ]}
                onActivate={() => {}}
            />
        ),
    }
)

figma.connect(
    ProductSwitcher,
    '<PLANVIEW_DESIGN_SYSTEM_FIGMA_DOCUMENT>?node-id=7355:20238',
    {
        variant: { Organization: 'On' },
        example: () => (
            <ProductSwitcher
                products={[
                    {
                        name: 'e1_prm',
                        label: 'Portfolios',
                        url: 'https://us.id.planview.com/api/go/E1_PRM/p-1234',
                        secondaryLabel: 'Sandbox environment',
                    },
                    {
                        name: 'ea',
                        label: 'EA',
                        url: '',
                        secondaryLabel: '',
                        active: true,
                    },
                ]}
                organization={{
                    name: 'Acme Corp',
                    domain: 'acme.planview.com',
                    avatar: { light: '', dark: '' },
                }}
                onActivate={() => {}}
            />
        ),
    }
)
