/**
 * @aurora-catalyst-generated
 * @source cliter/o-auth/scope.aurora.yaml
 */
import { type DataTableColumnDef } from '@aurora';
import { TranslocoService } from '@jsverse/transloco';
import { type OAuthScope } from '@src/src/app/aurora.types';

export const getScopeStandaloneColumns = (properties?: {
  translator?: TranslocoService;
}): DataTableColumnDef<OAuthScope>[] => {
  const { translator = null } = properties ?? {};

  return [
    {
      accessorKey: 'rowId',
      id: 'rowId',
      size: 100,
      label: () => translator?.translate('o-auth.scope.RowId') ?? 'RowId',
      sortable: true,
      filterable: true,
      exportable: true,
      cell: (info) => `${info.getValue<string>() ?? ''}`,
    },
    {
      accessorKey: 'code',
      id: 'code',
      size: 200,
      minSize: 120,
      label: () => translator?.translate('o-auth.scope.Code') ?? 'Code',
      sortable: true,
      searchable: true,
      filterable: true,
      exportable: true,
      cell: (info) => `${info.getValue<string>() ?? ''}`,
    },
    {
      accessorKey: 'name',
      id: 'name',
      size: 300,
      minSize: 160,
      label: () => translator?.translate('o-auth.scope.Name') ?? 'Name',
      sortable: true,
      searchable: true,
      filterable: true,
      exportable: true,
      cell: (info) => `${info.getValue<string>() ?? ''}`,
    },
    {
      accessorKey: 'roleIds',
      id: 'roleIds',
      size: 200,
      minSize: 120,
      label: () => translator?.translate('o-auth.scope.RoleIds') ?? 'RoleIds',
      sortable: true,
      filterable: true,
      exportable: true,
      cell: (info) => `${info.getValue<string>() ?? ''}`,
    },
  ];
};
