Skip to content

A plugin marketplace for GitHub Copilot and other AI agents that provides Power Platform development plugins, including reusable skills, agents, and commands for building and deploying solutions.

1.2 KB
Raw Blame
import * as React from "react";
import { CellRendererOverrides } from "../types";

export const cellRendererOverrides: CellRendererOverrides = {
    Text: (props) => {
        if (props.value == null) return null;
        const text = props.formattedValue ?? String(props.value);

        return React.createElement(
            "span",
            {
                className: "{{nameLower}}-text-renderer",
                dir: props.isRTLMode ? "rtl" : undefined,
                title: text,
            },
            text,
        );
    },
    // Choice (option set) cells: `value` is the stored option number and `formattedValue` is the
    // label the grid already resolved in the user's language, so show the label, never the number.
    // Without a label, return null so the grid's internal renderer shows the choice instead.
    OptionSet: (props) => {
        if (props.value == null || !props.formattedValue) return null;
        const label = props.formattedValue;

        return React.createElement(
            "span",
            {
                className: "{{nameLower}}-choice-renderer",
                dir: props.isRTLMode ? "rtl" : undefined,
                title: label,
            },
            label,
        );
    },
};