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

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

  return [
    {
      accessorKey: 'rowId',
      id: 'rowId',
      size: 100,
      label: () => translator?.translate('o-auth.client.RowId') ?? 'RowId',
      sortable: true,
      filterable: true,
      exportable: true,
      cell: (info) => `${info.getValue<string>() ?? ''}`,
    },
    {
      accessorKey: 'grantType',
      id: 'grantType',
      size: 120,
      label: () => translator?.translate('o-auth.client.GrantType') ?? 'GrantType',
      sortable: true,
      filterable: true,
      exportable: true,
      cell: (info) => `${info.getValue<string>() ?? ''}`,
    },
    {
      accessorKey: 'name',
      id: 'name',
      size: 300,
      minSize: 160,
      label: () => translator?.translate('o-auth.client.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.client.Secret') ?? 'Secret',
      sortable: true,
      searchable: true,
      filterable: true,
      exportable: true,
      cell: (info) => `${info.getValue<string>() ?? ''}`,
    },
    {
      accessorKey: 'authUrl',
      id: 'authUrl',
      size: 300,
      minSize: 160,
      label: () => translator?.translate('o-auth.client.AuthUrl') ?? 'AuthUrl',
      sortable: true,
      searchable: true,
      filterable: true,
      exportable: true,
      cell: (info) => `${info.getValue<string>() ?? ''}`,
    },
    {
      accessorKey: 'redirect',
      id: 'redirect',
      size: 300,
      minSize: 160,
      label: () => translator?.translate('o-auth.client.Redirect') ?? 'Redirect',
      sortable: true,
      searchable: true,
      filterable: true,
      exportable: true,
      cell: (info) => `${info.getValue<string>() ?? ''}`,
    },
    {
      accessorKey: 'scopeOptions',
      id: 'scopeOptions',
      size: 200,
      minSize: 120,
      label: () => translator?.translate('o-auth.client.ScopeOptions') ?? 'ScopeOptions',
      sortable: true,
      filterable: true,
      exportable: true,
      cell: (info) => `${info.getValue<string>() ?? ''}`,
    },
    {
      accessorKey: 'accessTokenLifetimeSeconds',
      id: 'accessTokenLifetimeSeconds',
      size: 100,
      label: () =>
        translator?.translate('o-auth.client.AccessTokenLifetimeSeconds') ??
        'AccessTokenLifetimeSeconds',
      sortable: true,
      filterable: true,
      exportable: true,
      cell: (info) => `${info.getValue<string>() ?? ''}`,
    },
    {
      accessorKey: 'refreshTokenLifetimeSeconds',
      id: 'refreshTokenLifetimeSeconds',
      size: 100,
      label: () =>
        translator?.translate('o-auth.client.RefreshTokenLifetimeSeconds') ??
        'RefreshTokenLifetimeSeconds',
      sortable: true,
      filterable: true,
      exportable: true,
      cell: (info) => `${info.getValue<string>() ?? ''}`,
    },
    {
      accessorKey: 'isActive',
      id: 'isActive',
      size: 100,
      label: () => translator?.translate('o-auth.client.IsActive') ?? 'IsActive',
      sortable: true,
      filterable: true,
      exportable: true,
      cell: () => flexRenderComponent(BooleanCell, { inputs: {} }),
    },
    {
      accessorKey: 'isMaster',
      id: 'isMaster',
      size: 100,
      label: () => translator?.translate('o-auth.client.IsMaster') ?? 'IsMaster',
      sortable: true,
      filterable: true,
      exportable: true,
      cell: () => flexRenderComponent(BooleanCell, { inputs: {} }),
    },
  ];
};
