/**
 * @aurora-catalyst-generated
 * @source cliter/o-auth/application.aurora.yaml
 */
import { BooleanCell, type DataTableColumnDef } from '@aurora';
import { TranslocoService } from '@jsverse/transloco';
import { type OAuthApplication } from '@src/src/app/aurora.types';
import { flexRenderComponent } from '@tanstack/angular-table';

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

  return [
    {
      accessorKey: 'rowId',
      id: 'rowId',
      size: 100,
      label: () => translator?.translate('o-auth.application.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.application.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.application.Name') ?? 'Name',
      sortable: true,
      searchable: true,
      filterable: true,
      exportable: true,
      cell: (info) => `${info.getValue<string>() ?? ''}`,
    },
    {
      accessorKey: 'secret',
      id: 'secret',
      size: 300,
      minSize: 160,
      label: () => translator?.translate('o-auth.application.Secret') ?? 'Secret',
      sortable: true,
      searchable: true,
      filterable: true,
      exportable: true,
      cell: (info) => `${info.getValue<string>() ?? ''}`,
    },
    {
      accessorKey: 'isMaster',
      id: 'isMaster',
      size: 100,
      label: () => translator?.translate('o-auth.application.IsMaster') ?? 'IsMaster',
      sortable: true,
      filterable: true,
      exportable: true,
      cell: () => flexRenderComponent(BooleanCell, { inputs: {} }),
    },
  ];
};
