- Add jscodeshift-based codemod to convert arrow function components to function declarations - Support React.FC, observer-wrapped, and forwardRef components - Include comprehensive test suite covering edge cases - Add npm script to run transformer across codebase - Target only .tsx files in source directories, excluding node_modules and declaration files * [WEB-5459] chore: updates after running codemod --------- Co-authored-by: sriramveeraghanta <veeraghanta.sriram@gmail.com>
30 lines
1.2 KiB
TypeScript
30 lines
1.2 KiB
TypeScript
import { Info } from "lucide-react";
|
|
// plane constants
|
|
import type { TAdminAuthErrorInfo } from "@plane/constants";
|
|
// icons
|
|
import { CloseIcon } from "@plane/propel/icons";
|
|
|
|
type TAuthBanner = {
|
|
bannerData: TAdminAuthErrorInfo | undefined;
|
|
handleBannerData?: (bannerData: TAdminAuthErrorInfo | undefined) => void;
|
|
};
|
|
|
|
export function AuthBanner(props: TAuthBanner) {
|
|
const { bannerData, handleBannerData } = props;
|
|
|
|
if (!bannerData) return <></>;
|
|
return (
|
|
<div className="relative flex items-center p-2 rounded-md gap-2 border border-custom-primary-100/50 bg-custom-primary-100/10">
|
|
<div className="w-4 h-4 flex-shrink-0 relative flex justify-center items-center">
|
|
<Info size={16} className="text-custom-primary-100" />
|
|
</div>
|
|
<div className="w-full text-sm font-medium text-custom-primary-100">{bannerData?.message}</div>
|
|
<div
|
|
className="relative ml-auto w-6 h-6 rounded-sm flex justify-center items-center transition-all cursor-pointer hover:bg-custom-primary-100/20 text-custom-primary-100/80"
|
|
onClick={() => handleBannerData && handleBannerData(undefined)}
|
|
>
|
|
<CloseIcon className="w-4 h-4 flex-shrink-0" />
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|