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

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

  return [
    {
      accessorKey: 'rowId',
      id: 'rowId',
      size: 100,
      label: () => translator?.translate('iam.user.RowId') ?? 'RowId',
      sortable: true,
      filterable: true,
      exportable: true,
      cell: (info) => `${info.getValue<string>() ?? ''}`,
    },
    {
      accessorKey: 'name',
      id: 'name',
      size: 300,
      minSize: 160,
      label: () => translator?.translate('iam.user.Name') ?? 'Name',
      sortable: true,
      searchable: true,
      filterable: true,
      exportable: true,
      cell: (info) => `${info.getValue<string>() ?? ''}`,
    },
    {
      accessorKey: 'surname',
      id: 'surname',
      size: 300,
      minSize: 160,
      label: () => translator?.translate('iam.user.Surname') ?? 'Surname',
      sortable: true,
      searchable: true,
      filterable: true,
      exportable: true,
      cell: (info) => `${info.getValue<string>() ?? ''}`,
    },
    {
      accessorKey: 'avatar',
      id: 'avatar',
      size: 300,
      minSize: 160,
      label: () => translator?.translate('iam.user.Avatar') ?? 'Avatar',
      sortable: true,
      searchable: true,
      filterable: true,
      exportable: true,
      cell: (info) => `${info.getValue<string>() ?? ''}`,
    },
    {
      accessorKey: 'mobile',
      id: 'mobile',
      size: 200,
      minSize: 120,
      label: () => translator?.translate('iam.user.Mobile') ?? 'Mobile',
      sortable: true,
      searchable: true,
      filterable: true,
      exportable: true,
      cell: (info) => `${info.getValue<string>() ?? ''}`,
    },
    {
      accessorKey: 'password',
      id: 'password',
      size: 200,
      minSize: 120,
      label: () => translator?.translate('iam.user.Password') ?? 'Password',
      sortable: true,
      filterable: true,
      exportable: true,
      cell: (info) => `${info.getValue<string>() ?? ''}`,
    },
    {
      accessorKey: 'isTwoFactorAuthenticationEnabled',
      id: 'isTwoFactorAuthenticationEnabled',
      size: 100,
      label: () =>
        translator?.translate('iam.user.IsTwoFactorAuthenticationEnabled') ??
        'IsTwoFactorAuthenticationEnabled',
      sortable: true,
      filterable: true,
      exportable: true,
      cell: () => flexRenderComponent(BooleanCell, { inputs: {} }),
    },
    {
      accessorKey: 'twoFactorAuthenticationSecret',
      id: 'twoFactorAuthenticationSecret',
      size: 200,
      minSize: 120,
      label: () =>
        translator?.translate('iam.user.TwoFactorAuthenticationSecret') ??
        'TwoFactorAuthenticationSecret',
      sortable: true,
      searchable: true,
      filterable: true,
      exportable: true,
      cell: (info) => `${info.getValue<string>() ?? ''}`,
    },
    {
      accessorKey: 'rememberToken',
      id: 'rememberToken',
      size: 300,
      minSize: 160,
      label: () => translator?.translate('iam.user.RememberToken') ?? 'RememberToken',
      sortable: true,
      searchable: true,
      filterable: true,
      exportable: true,
      cell: (info) => `${info.getValue<string>() ?? ''}`,
    },
  ];
};
