diff --git a/src/components/Loader/Loader.stories.tsx b/src/components/Loader/Loader.stories.tsx index 7c380ff..c365a65 100644 --- a/src/components/Loader/Loader.stories.tsx +++ b/src/components/Loader/Loader.stories.tsx @@ -9,24 +9,11 @@ const meta: Meta = { controls: { expanded: true }, }, argTypes: { - type: { - control: { - control: { type: 'radio' }, - options: ['default', 'raccord'], - }, - description: 'Type of the loader', - defaultValue: 'default', - }, size: { control: 'number', description: 'Size of the loader', defaultValue: 24, }, - customClass: { - control: 'text', - description: 'Additional custom CSS classes for styling', - defaultValue: '', - }, }, }; @@ -37,8 +24,6 @@ type Story = StoryObj; export const _Loader: Story = { render: (args) => , args: { - type: 'default', size: 24, - customClass: '', }, }; diff --git a/src/components/Loader/Loader.test.tsx b/src/components/Loader/Loader.test.tsx index efdea55..99a7694 100644 --- a/src/components/Loader/Loader.test.tsx +++ b/src/components/Loader/Loader.test.tsx @@ -12,14 +12,3 @@ describe('Components | loader', () => { expect(loader).toBeTruthy(); }); }); - -// loader with type secondary -describe('Components | loader', () => { - test('it should render', () => { - render(); - - let loader = screen.getByTestId('loader'); - - expect(loader).toBeTruthy(); - }); -}); diff --git a/src/components/Loader/Loader.tsx b/src/components/Loader/Loader.tsx index a6e176f..d858589 100644 --- a/src/components/Loader/Loader.tsx +++ b/src/components/Loader/Loader.tsx @@ -1,32 +1,28 @@ -// eslint-disable-next-line @typescript-eslint/ban-ts-comment -// @ts-ignore -import React, { ComponentPropsWithoutRef } from 'react'; +import React, { forwardRef } from 'react'; import { LoaderCircle } from 'lucide-react'; -import Logo from '../../assets/images/loading.gif'; +import { cn } from '../../lib/utils'; -const TypeLoader = { - default: 'default', - raccord: 'raccord', -}; - -interface LoaderProps extends ComponentPropsWithoutRef<'div'> { - customClass?: string; +interface LoaderProps extends React.HTMLAttributes { size?: number; - type?: keyof typeof TypeLoader; } -export function Loader(props: LoaderProps) { - const { size = 24, customClass = '', type = 'default', ...rest } = props; +const Loader = forwardRef((props, ref) => { + const { size = 24, className, ...rest } = props; return ( -
- {type === 'default' ? ( - - ) : ( - loading - )} -
+ ); -} +}); + +Loader.displayName = 'Loader'; + +export { Loader };