Files
plane/apps/admin/core/components/authentication/authentication-method-card.tsx
T

60 lines
1.6 KiB
TypeScript
Raw Normal View History

2026-01-27 13:54:22 +05:30
/**
* Copyright (c) 2023-present Plane Software, Inc. and contributors
* SPDX-License-Identifier: AGPL-3.0-only
* See the LICENSE file for details.
*/
2024-05-08 23:01:20 +05:30
// helpers
2024-12-20 20:44:46 +05:30
import { cn } from "@plane/utils";
2024-05-08 23:01:20 +05:30
type Props = {
name: string;
description: string;
icon: React.ReactNode;
config: React.ReactNode;
2024-05-08 23:01:20 +05:30
disabled?: boolean;
withBorder?: boolean;
unavailable?: boolean;
2024-05-08 23:01:20 +05:30
};
export function AuthenticationMethodCard(props: Props) {
const { name, description, icon, config, disabled = false, withBorder = true, unavailable = false } = props;
2024-05-08 23:01:20 +05:30
return (
<div
className={cn("w-full flex items-center gap-14 rounded-lg bg-layer-2", {
2025-12-12 20:50:14 +05:30
"px-4 py-3 border border-subtle": withBorder,
2024-05-08 23:01:20 +05:30
})}
>
<div
className={cn("flex grow items-center gap-4", {
"opacity-50": unavailable,
})}
>
2024-05-08 23:01:20 +05:30
<div className="shrink-0">
2025-12-12 20:50:14 +05:30
<div className="flex h-10 w-10 items-center justify-center rounded-full bg-layer-1">{icon}</div>
2024-05-08 23:01:20 +05:30
</div>
<div className="grow">
<div
2025-12-12 20:50:14 +05:30
className={cn("font-medium leading-5 text-primary", {
"text-13": withBorder,
"text-18": !withBorder,
2024-05-08 23:01:20 +05:30
})}
>
{name}
</div>
<div
2025-12-12 20:50:14 +05:30
className={cn("font-regular leading-5 text-tertiary", {
"text-11": withBorder,
"text-13": !withBorder,
2024-05-08 23:01:20 +05:30
})}
>
{description}
</div>
</div>
</div>
<div className={`shrink-0 ${disabled && "opacity-70"}`}>{config}</div>
</div>
);
}