<commit_before>import React, { useEffect } from 'react';
import { c } from 'ttag';
import { Sidebar, useToggle, PrivateAppContainer } from 'react-components';
import { match as Match } from 'react-router-dom';
import { Location } from 'history';
import Header from './PrivateHeader';
import UploadButton from '../uploads/UploadButton';
import TransfersInfo from '../TransfersInfo/TransfersInfo';

const getSidebar = () => {
    return [
        {
            text: c('Link').t`My files`,
            link: '/drive',
            isActive: (match: Match, location: Location) => match.isExact || !location.pathname.includes('trash'),
            icon: 'inbox'
        },
        {
            text: c('Link').t`Trash`,
            link: '/drive/trash',
            icon: 'trash'
        }
    ];
};

interface Props {
    children: React.ReactNode;
}

const PrivateLayout = ({ children }: Props) => {
    const { state: isHeaderExpanded, toggle: toggleHeaderExpanded, set: setExpand } = useToggle();<commit_msg>Fix sidebar isExact throwing error while loading<commit_after>import React, { useEffect } from 'react';
import { c } from 'ttag';
import { Sidebar, useToggle, PrivateAppContainer } from 'react-components';
import { match as Match } from 'react-router-dom';
import { Location } from 'history';
import Header from './PrivateHeader';
import UploadButton from '../uploads/UploadButton';
import TransfersInfo from '../TransfersInfo/TransfersInfo';

const getSidebar = () => {
    return [
        {
            text: c('Link').t`My files`,
            link: '/drive',
            isActive: (match: Match, location: Location) =>
                !!match && (match.isExact || !location.pathname.includes('trash')),
            icon: 'inbox'
        },
        {
            text: c('Link').t`Trash`,
            link: '/drive/trash',
            icon: 'trash'
        }
    ];
};

interface Props {
    children: React.ReactNode;
}

const PrivateLayout = ({ children }: Props) => {
    const { state: isHeaderExpanded, toggle: toggleHeaderExpanded, set: setExpand } = useToggle();
{'fraction_non_alphanumeric': 0.1451923076923077, 'fraction_numerical': 0.0, 'mean_word_length': 2.7495495495495494, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3434690', 'n_tokens_mistral': 598, 'n_tokens_neox': 593, 'n_words': 158}