* fix: remove unused imports and variables (part 1) Resolve oxlint no-unused-vars warnings in packages/*, apps/admin, apps/space, apps/live, and apps/web (non-core). * fix: resolve CI check failures * fix: resolve check:types failures * fix: resolve check:types and check:format failures - Use destructuring alias for activeCycleResolvedPath - Format propel tab-navigation file * fix: format propel button helper with oxfmt Reorder Tailwind classes to match oxfmt canonical ordering.
52 lines
1.5 KiB
TypeScript
52 lines
1.5 KiB
TypeScript
/**
|
|
* Copyright (c) 2023-present Plane Software, Inc. and contributors
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
* See the LICENSE file for details.
|
|
*/
|
|
|
|
import React from "react";
|
|
import type { ISvgIcons } from "@plane/propel/icons";
|
|
import { DropdownIcon } from "@plane/propel/icons";
|
|
import { cn } from "../utils";
|
|
|
|
type Props = {
|
|
isOpen: boolean;
|
|
title: React.ReactNode;
|
|
hideChevron?: boolean;
|
|
indicatorElement?: React.ReactNode;
|
|
actionItemElement?: React.ReactNode;
|
|
className?: string;
|
|
titleClassName?: string;
|
|
ChevronIcon?: React.FC<ISvgIcons>;
|
|
};
|
|
|
|
export function CollapsibleButton(props: Props) {
|
|
const {
|
|
isOpen,
|
|
title,
|
|
hideChevron = false,
|
|
indicatorElement,
|
|
actionItemElement,
|
|
className = "",
|
|
titleClassName = "",
|
|
ChevronIcon = DropdownIcon,
|
|
} = props;
|
|
return (
|
|
<div className={cn("flex h-12 items-center justify-between gap-3 border-b border-subtle px-2.5 py-3", className)}>
|
|
<div className="flex items-center gap-3.5">
|
|
<div className="flex items-center gap-3">
|
|
{!hideChevron && (
|
|
<ChevronIcon
|
|
className={cn("size-2 text-tertiary duration-300 hover:text-secondary", {
|
|
"-rotate-90": !isOpen,
|
|
})}
|
|
/>
|
|
)}
|
|
<span className={cn("text-14 font-medium text-primary", titleClassName)}>{title}</span>
|
|
</div>
|
|
{indicatorElement && indicatorElement}
|
|
</div>
|
|
{actionItemElement && isOpen && actionItemElement}
|
|
</div>
|
|
);
|
|
}
|