mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-14 08:29:55 +00:00
feat(ui): added new components empty state and skeleton
This commit is contained in:
@@ -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';
|
||||
Reference in New Issue
Block a user