/**
 * @aurora-catalyst-generated
 * @source cliter/iam/permission-role.aurora.yaml
 */
import { type DataTableColumnDef } from '@aurora';
import { TranslocoService } from '@jsverse/transloco';
import { type IamPermissionRole } from '@src/src/app/aurora.types';

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

  return [
    {
      accessorKey: 'permission.name',
      id: 'permission.name',
      relation: { association: 'permission' },
      label: () => translator?.translate('iam.permission-role.Permission') ?? 'Permission',
      sortable: true,
      searchable: true,
      filterable: true,
      exportable: true,
      cell: (info) => `${info.getValue<string>() ?? ''}`,
    },
    {
      accessorKey: 'role.name',
      id: 'role.name',
      relation: { association: 'role' },
      label: () => translator?.translate('iam.permission-role.Role') ?? 'Role',
      sortable: true,
      searchable: true,
      filterable: true,
      exportable: true,
      cell: (info) => `${info.getValue<string>() ?? ''}`,
    },
  ];
};
