import {
  createColumnLoader,
  ColumnMetadata,
} from '../DataGrid/configBuilderFactory';

const ASSET_VARIANTS_COLUMNS: ColumnMetadata[] = [
  {
    field: 'asset',
    headerName: 'Asset',
    type: 'singleSelectRelation',
    entityRef: 'assets',
    editable: true,
  },
  {
    field: 'variant_type',
    headerName: 'Varianttype',
    type: 'text',
    editable: true,
  },
  { field: 'cdn_url', headerName: 'CDNURL', type: 'text', editable: true },
  {
    field: 'width_px',
    headerName: 'Width(px)',
    type: 'number',
    editable: true,
  },
  {
    field: 'height_px',
    headerName: 'Height(px)',
    type: 'number',
    editable: true,
  },
  { field: 'size_mb', headerName: 'Size(MB)', type: 'number', editable: true },
  { field: 'actions', headerName: '', type: 'actions' },
];

export const loadColumns = createColumnLoader({
  entityName: 'asset_variants',
  columns: ASSET_VARIANTS_COLUMNS,
});
