import { Component } from '@angular/core';
import {CalculatePageRangePipe} from "../../corelib/calculate-page-range.pipe";
import {CuteLoadingComponent} from "../../corelib/components/cute-loading/cute-loading.component";
import {DatePipe, DecimalPipe, NgForOf, NgIf} from "@angular/common";
import {
  CodeWithCopyButtonComponent
} from "../../corelib/components/code-with-copy-button/code-with-copy-button.component";
import {RouterLink} from "@angular/router";
import {ApiTryItComponent} from "../../corelib/components/api-try-it/api-try-it.component";

@Component({
  selector: 'app-api',
  standalone: true,
  imports: [
    CalculatePageRangePipe,
    CuteLoadingComponent,
    DatePipe,
    DecimalPipe,
    NgForOf,
    NgIf,
    CodeWithCopyButtonComponent,
    RouterLink,
    ApiTryItComponent
  ],
  templateUrl: './api.component.html',
  styleUrl: './api.component.css'
})
export class ApiComponent {

  placeholderSearchValue = "{\"queries\":[{\"predicates\":[{\"field\":{\"name\":\"user_rank\",\"type\":\"number\"},\"operator\":{\"operatorType\":\"<\",\"acceptsValues\":\"any\"},\"value\":\"50\"},{\"field\":{\"name\":\"ur\",\"type\":\"number\"},\"operator\":{\"operatorType\":\"<\",\"acceptsValues\":\"any\"},\"value\":\"120\"}],\"logicalOperator\":\"AND\"}],\"sorting\":{\"field\":\"user_id\",\"order\":\"ASC\"},\"page\":1}";
  placeholderUserSearchValue = "{\"queries\":[{\"predicates\":[{\"field\":{\"name\":\"rank\",\"type\":\"number\"},\"operator\":{\"operatorType\":\">\",\"acceptsValues\":\"any\"},\"value\":\"10\"},{\"field\":{\"name\":\"username\",\"type\":\"string\"},\"operator\":{\"operatorType\":\"=\",\"acceptsValues\":\"any\"},\"value\":\"degenerate\"}],\"logicalOperator\":\"AND\"}],\"sorting\":{\"field\":\"user_id\",\"order\":\"ASC\"},\"page\":1}";

}
