feat(ui): added new components empty state and skeleton

This commit is contained in:
akhilmhdh
2023-02-22 23:27:36 +05:30
parent af64582efd
commit 621b640af4
12 changed files with 283 additions and 161 deletions
@@ -0,0 +1,20 @@
import type { Meta, StoryObj } from '@storybook/react';
import { EmptyState } from './EmptyState';
const meta: Meta<typeof EmptyState> = {
title: 'Components/EmptyState',
component: EmptyState,
tags: ['v2'],
argTypes: {},
args: {
title: 'No members found'
}
};
export default meta;
type Story = StoryObj<typeof EmptyState>;
export const Basic: Story = {
render: (args) => <EmptyState {...args} />
};
@@ -0,0 +1,21 @@
import { ReactNode } from 'react';
import { faCubesStacked, IconDefinition } from '@fortawesome/free-solid-svg-icons';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { twMerge } from 'tailwind-merge';
type Props = {
title: ReactNode;
className?: string;
children?: ReactNode;
icon?: IconDefinition;
};
export const EmptyState = ({ title, className, children, icon = faCubesStacked }: Props) => (
<div className={twMerge('flex w-full flex-col items-center p-8 text-mineshaft-50', className)}>
<div className="mb-4">
<FontAwesomeIcon icon={icon} size="3x" />
</div>
<div className="mb-8 text-gray-300">{title}</div>
<div>{children}</div>
</div>
);
@@ -0,0 +1 @@
export { EmptyState } from './EmptyState';