/*
 * 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";

export const GanttChart: React.FC<SVGIconProps> = React.forwardRef<any, SVGIconProps>((props, ref) => {
    const isLarge = (props.size ?? IconSize.STANDARD) >= IconSize.LARGE;
    const pixelGridSize = isLarge ? IconSize.LARGE : IconSize.STANDARD;
    const translation = `${-1 * pixelGridSize / 0.05 / 2}`;
    const style = { transformOrigin: "center" };
    return (
        <SVGIconContainer iconName="gantt-chart" ref={ref} {...props}>
            <path
                d={isLarge ? "M80 260H180C191 260 200 269 200 280V300C200 311 191 320 180 320H80C69 320 60 311 60 300V280C60 269 69 260 80 260M140 220V200C140 189 149 180 160 180H280C291 180 300 189 300 200V220C300 231 291 240 280 240H160C149 240 140 231 140 220M380 160H260C249 160 240 151 240 140V120C240 109 249 100 260 100H380C391 100 400 109 400 120V140C400 151 391 160 380 160M380 80H40V340C40 351 31 360 20 360S0 351 0 340V60C0 49 9 40 20 40H380C391 40 400 49 400 60S391 80 380 80" : "M200 120C200 109 209 100 220 100H300C311 100 320 109 320 120S311 140 300 140H220C209 140 200 131 200 120M120 180C120 169 129 160 140 160H220C231 160 240 169 240 180S231 200 220 200H140C129 200 120 191 120 180M300 80H40V260C40 271 31 280 20 280S0 271 0 260V60C0 49 9 40 20 40H300C311 40 320 49 320 60S311 80 300 80M80 220H140C151 220 160 229 160 240S151 260 140 260H80C69 260 60 251 60 240S69 220 80 220"}
                fillRule="evenodd"
                transform={`scale(0.05, -0.05) translate(${translation}, ${translation})`}
                style={style}
            />
        </SVGIconContainer>
   );
});
GanttChart.displayName = `Blueprint6.Icon.GanttChart`;
export default GanttChart;
