<commit_before>import { VFC } from 'react';
import { FeatureSchema } from 'openapi';
import { Link, styled, Typography } from '@mui/material';
import { TextCell } from '../TextCell/TextCell';
import { HtmlTooltip } from 'component/common/HtmlTooltip/HtmlTooltip';
import { Highlighter } from 'component/common/Highlighter/Highlighter';
import { useSearchHighlightContext } from 'component/common/Table/SearchHighlightContext/SearchHighlightContext';

const StyledTag = styled(Typography)(({ theme }) => ({
    fontSize: theme.fontSizes.smallerBody,
}));

const StyledLink = styled(Link, {
    shouldForwardProp: prop => prop !== 'highlighted',
})<{ highlighted?: boolean }>(({ theme, highlighted }) => ({
    backgroundColor: highlighted ? theme.palette.highlight : 'transparent',
}));

interface IFeatureTagCellProps {
    row: {
        original: FeatureSchema;
    };
    value: string;
}

export const FeatureTagCell: VFC<IFeatureTagCellProps> = ({ row, value }) => {
    const { searchQuery } = useSearchHighlightContext();

    if (!row.original.tags || row.original.tags.length === 0)
        return <TextCell />;

    return (
        <TextCell>
            <HtmlTooltip
                title={
                    <>
                        {row.original.tags?.map(tag => (
                            <StyledTag key={tag.type + tag.value}>
                                <Highlighter search={searchQuery}>
                                    {`${tag.type}:${tag.value}`}
                                </Highlighter>
                            </StyledTag>
                        ))}
                    </>
                }
            >
                <StyledLink
                    underline="always"
                    highlighted={
                        searchQuery.length > 0 && value.includes(searchQuery)
                    }
                >
                    {row.original.tags?.length === 1
                        ? '1 tag'
                        : `${row.original.tags?.length} tags`}<commit_msg>fix: tags highlight case sensitivity (#2462)<commit_after>import { VFC } from 'react';
import { FeatureSchema } from 'openapi';
import { Link, styled, Typography } from '@mui/material';
import { TextCell } from '../TextCell/TextCell';
import { HtmlTooltip } from 'component/common/HtmlTooltip/HtmlTooltip';
import { Highlighter } from 'component/common/Highlighter/Highlighter';
import { useSearchHighlightContext } from 'component/common/Table/SearchHighlightContext/SearchHighlightContext';

const StyledTag = styled(Typography)(({ theme }) => ({
    fontSize: theme.fontSizes.smallerBody,
}));

const StyledLink = styled(Link, {
    shouldForwardProp: prop => prop !== 'highlighted',
})<{ highlighted?: boolean }>(({ theme, highlighted }) => ({
    backgroundColor: highlighted ? theme.palette.highlight : 'transparent',
}));

interface IFeatureTagCellProps {
    row: {
        original: FeatureSchema;
    };
    value: string;
}

export const FeatureTagCell: VFC<IFeatureTagCellProps> = ({ row, value }) => {
    const { searchQuery } = useSearchHighlightContext();

    if (!row.original.tags || row.original.tags.length === 0)
        return <TextCell />;

    return (
        <TextCell>
            <HtmlTooltip
                title={
                    <>
                        {row.original.tags?.map(tag => (
                            <StyledTag key={tag.type + tag.value}>
                                <Highlighter search={searchQuery}>
                                    {`${tag.type}:${tag.value}`}
                                </Highlighter>
                            </StyledTag>
                        ))}
                    </>
                }
            >
                <StyledLink
                    underline="always"
                    highlighted={
                        searchQuery.length > 0 &&
                        value.toLowerCase().includes(searchQuery.toLowerCase())
                    }
                >
                    {row.original.tags?.length === 1
                        ? '1 tag'
                        : `${row.original.tags?.length} tags`}
{'fraction_non_alphanumeric': 0.12671645386653818, 'fraction_numerical': 0.002890869669959046, 'mean_word_length': 1.703125, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5631052', 'n_tokens_mistral': 1098, 'n_tokens_neox': 1039, 'n_words': 200}