bb-plane-fork/web/core/components/settings/heading.tsx
Akshita Goyal d65f0e264e
[WEB-4327] Chore PAT permissions (#7224)
* chore: improved pat permissions

* fix: err message

* fix: removed permission from backend

* [WEB-4330] refactor: update API token endpoints to use user context instead of workspace slug

- Changed URL patterns for API token endpoints to use "users/api-tokens/" instead of "workspaces/<str:slug>/api-tokens/".
- Refactored ApiTokenEndpoint methods to remove workspace slug parameter and adjust database queries accordingly.
- Added new test cases for API token creation, retrieval, deletion, and updates, including support for bot users and minimal data submissions.

* fix: removed workspace slug from api-tokens

* fix: refactor

* chore: url.py code rabbit suggestion

* fix: APITokenService moved to package

---------

Co-authored-by: Dheeraj Kumar Ketireddy <dheeru0198@gmail.com>
Co-authored-by: sriramveeraghanta <veeraghanta.sriram@gmail.com>
2025-06-18 16:08:11 +05:30

38 lines
1 KiB
TypeScript

import { Button } from "@plane/ui";
type Props = {
title: string | React.ReactNode;
description?: string;
appendToRight?: React.ReactNode;
showButton?: boolean;
customButton?: React.ReactNode;
button?: {
label: string;
onClick: () => void;
};
};
export const SettingsHeading = ({
title,
description,
button,
appendToRight,
customButton,
showButton = true,
}: Props) => (
<div className="flex flex-col md:flex-row gap-2 items-start md:items-center justify-between border-b border-custom-border-100 pb-3.5">
<div className="flex flex-col items-start gap-1">
{typeof title === "string" ? <h3 className="text-xl font-medium">{title}</h3> : title}
{description && <div className="text-sm text-custom-text-300">{description}</div>}
</div>
{showButton && customButton}
{button && showButton && (
<Button variant="primary" onClick={button.onClick} size="sm" className="w-fit">
{button.label}
</Button>
)}
{appendToRight}
</div>
);
export default SettingsHeading;