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

const PROJECT_AUDIO_TRACKS_COLUMNS: ColumnMetadata[] = [
  {
    field: 'project',
    headerName: 'Project',
    type: 'singleSelectRelation',
    entityRef: 'projects',
    editable: true,
  },
  {
    field: 'environment',
    headerName: 'Environment',
    type: 'text',
    editable: true,
  },
  {
    field: 'source_key',
    headerName: 'Sourcekey',
    type: 'text',
    editable: true,
  },
  { field: 'name', headerName: 'Name', type: 'text', editable: true },
  { field: 'slug', headerName: 'Slug', type: 'text', editable: true },
  { field: 'url', headerName: 'URL', type: 'text', editable: true },
  { field: 'loop', headerName: 'Loop', type: 'boolean', editable: true },
  { field: 'volume', headerName: 'Volume', type: 'number', editable: true },
  {
    field: 'sort_order',
    headerName: 'Sortorder',
    type: 'number',
    editable: true,
  },
  {
    field: 'is_enabled',
    headerName: 'Isenabled',
    type: 'boolean',
    editable: true,
  },
  { field: 'actions', headerName: '', type: 'actions' },
];

export const loadColumns = createColumnLoader({
  entityName: 'project_audio_tracks',
  columns: PROJECT_AUDIO_TRACKS_COLUMNS,
});
