mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
39 lines
876 B
TypeScript
39 lines
876 B
TypeScript
/**
|
|
* Copyright (c) OpenLens Authors. All rights reserved.
|
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
|
*/
|
|
|
|
import styles from "./drawer-title.module.css";
|
|
import React from "react";
|
|
import { cssNames } from "../../utils";
|
|
|
|
export interface DrawerTitleProps {
|
|
className?: string;
|
|
children?: React.ReactNode;
|
|
|
|
/**
|
|
* @deprecated Prefer passing the value as `children`
|
|
*/
|
|
title?: React.ReactNode;
|
|
|
|
/**
|
|
* Specifies how large this title is
|
|
*
|
|
* @default "title"
|
|
*/
|
|
size?: "sub-title" | "title";
|
|
}
|
|
|
|
export function DrawerTitle({ className, children, size = "title" }: DrawerTitleProps) {
|
|
return (
|
|
<div
|
|
className={cssNames(styles.DrawerTitle, className, {
|
|
[styles.title]: size === "title",
|
|
[styles["sub-title"]]: size === "sub-title",
|
|
})}
|
|
>
|
|
{children}
|
|
</div>
|
|
);
|
|
}
|