StatusFormatterConfigType: {
    dataType: string;
    mapping: Record<string, {
        classList: string;
        title: string;
    }>;
    type: string;
}

The configuration object for the Status formatter.

Type declaration

  • dataType: string

    The field's data type in the server's response DTO. The possible values are 'integer', 'boolean', 'text'. It the data type is 'integer', that means the field type in the response is numeric. If the data type is 'boolean', that means the field type in the response is boolean (true/false). If the data type is 'text', that means the field type in the response is text.

  • mapping: Record<string, {
        classList: string;
        title: string;
    }>

    The object mapping for the status formatter.

    dataType: 'text',
    mapping: {
    'active': {
    classList: 'bg-green-500 text-white',
    title: 'Active'
    },
    'inactive': {
    classList: 'bg-red-500 text-white',
    title: 'Inactive'
    }
    }
    dataType: 'boolean',
    mapping: {
    'true': {
    classList: 'bg-green-500 text-white',
    title: 'Yes'
    },
    'false': {
    classList: 'bg-red-500 text-white',
    title: 'No'
    }
    }
    dataType: 'integer',
    mapping: {
    '1': {
    classList: 'bg-green-500 text-white',
    title: 'First'
    },
    '2': {
    classList: 'bg-red-500 text-white',
    title: 'Second'
    }
    }
  • type: string

    The type of the formatter. In this case, it should be 'Status'.