/*
 * Copyright 2024 Palantir Technologies, Inc. All rights reserved.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import * as React from "react";
import type { SVGIconProps } from "../../svgIconProps";
import { IconSize } from "../../iconTypes";
import { SVGIconContainer } from "../../svgIconContainer";

/** Path data for the 16px grid; matches {@link generate-icon-paths.mjs} / `<Icon />` from core. */
const PATHS_16 = ["M9.1 8A1.1 1.1 0 0 0 8 9.1v2.898a1 1 0 0 0-.328-.739l-.036-.037-2.929-2.93a1 1 0 0 0-1.414 1.415L4.586 11H3a1 1 0 0 1-1-1V1a1 1 0 1 0-2 0v9a3 3 0 0 0 3 3h1.586l-1.293 1.293a1 1 0 1 0 1.414 1.414l2.93-2.93.035-.036A1 1 0 0 0 8 12.002V14.9A1.1 1.1 0 0 0 9.1 16h5.8a1.1 1.1 0 0 0 1.1-1.1V9.1A1.1 1.1 0 0 0 14.9 8zm4.9 6h-4v-4h4z"] as readonly string[];

/** Path data for the 20px grid; matches {@link generate-icon-paths.mjs} / `<Icon />` from core. */
const PATHS_20 = ["M3 14a1 1 0 0 1-1-1V1a1 1 0 0 0-2 0v12a3 3 0 0 0 3 3h2.872l-2.293 2.293a1 1 0 1 0 1.414 1.414l4.215-4.215q.141-.142.22-.316V18.9a1.1 1.1 0 0 0 1.1 1.1H18.9a1.1 1.1 0 0 0 1.1-1.1v-8.371a1.1 1.1 0 0 0-1.1-1.1h-8.371a1.1 1.1 0 0 0-1.1 1.1v3.723a1.1 1.1 0 0 0-.221-.316L4.993 9.722a1 1 0 1 0-1.414 1.415L6.443 14zm8.429 4v-6.571H18v6.57z"] as readonly string[];

export const Descendant: React.FC<SVGIconProps> = React.forwardRef<any, SVGIconProps>((props, ref) => {
    const isLarge = (props.size ?? IconSize.STANDARD) >= IconSize.LARGE;
    const paths = isLarge ? PATHS_20 : PATHS_16;
    return (
        <SVGIconContainer iconName="descendant" ref={ref} {...props}>
            {paths.map((d, i) => (
                <path key={i} d={d} fillRule="evenodd" />
            ))}
        </SVGIconContainer>
    );
});
Descendant.displayName = `Blueprint6.Icon.Descendant`;
export default Descendant;
