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

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

  return [
    {
      accessorKey: 'rowId',
      id: 'rowId',
      size: 100,
      label: () => translator?.translate('o-auth.refresh-token.RowId') ?? 'RowId',
      sortable: true,
      filterable: true,
      exportable: true,
      cell: (info) => `${info.getValue<string>() ?? ''}`,
    },
    {
      accessorKey: 'token',
      id: 'token',
      size: 300,
      minSize: 160,
      label: () => translator?.translate('o-auth.refresh-token.Token') ?? 'Token',
      sortable: true,
      searchable: true,
      filterable: true,
      exportable: true,
      cell: (info) => `${info.getValue<string>() ?? ''}`,
    },
    {
      accessorKey: 'isRevoked',
      id: 'isRevoked',
      size: 100,
      label: () => translator?.translate('o-auth.refresh-token.IsRevoked') ?? 'IsRevoked',
      sortable: true,
      filterable: true,
      exportable: true,
      cell: () => flexRenderComponent(BooleanCell, { inputs: {} }),
    },
    {
      accessorKey: 'expiresAt',
      id: 'expiresAt',
      size: 140,
      label: () => translator?.translate('o-auth.refresh-token.ExpiresAt') ?? 'ExpiresAt',
      sortable: true,
      filterable: true,
      exportable: true,
      cell: (info) => `${info.getValue<string>() ?? ''}`,
    },
  ];
};
