website refactor
This commit is contained in:
26
apps/website/components/shared/SharedEmptyState.tsx
Normal file
26
apps/website/components/shared/SharedEmptyState.tsx
Normal file
@@ -0,0 +1,26 @@
|
||||
'use client';
|
||||
|
||||
import { LucideIcon } from 'lucide-react';
|
||||
import { EmptyState } from '@/ui/EmptyState';
|
||||
|
||||
interface SharedEmptyStateProps {
|
||||
icon: LucideIcon;
|
||||
title: string;
|
||||
description?: string;
|
||||
action?: {
|
||||
label: string;
|
||||
onClick: () => void;
|
||||
variant?: 'primary' | 'secondary' | 'ghost' | 'danger' | 'race-final' | 'discord';
|
||||
};
|
||||
}
|
||||
|
||||
export function SharedEmptyState({ icon, title, description, action }: SharedEmptyStateProps) {
|
||||
return (
|
||||
<EmptyState
|
||||
icon={icon}
|
||||
title={title}
|
||||
description={description}
|
||||
action={action}
|
||||
/>
|
||||
);
|
||||
}
|
||||
42
apps/website/components/shared/UIComponents.tsx
Normal file
42
apps/website/components/shared/UIComponents.tsx
Normal file
@@ -0,0 +1,42 @@
|
||||
import { Pagination } from '@/ui/Pagination';
|
||||
import { Text } from '@/ui/Text';
|
||||
import { Box } from '@/ui/Box';
|
||||
import { Stack } from '@/ui/Stack';
|
||||
import { Container } from '@/ui/Container';
|
||||
import { ConfirmDialog } from '@/ui/ConfirmDialog';
|
||||
import { Button } from '@/ui/Button';
|
||||
import { Icon } from '@/ui/Icon';
|
||||
import { Card } from '@/ui/Card';
|
||||
import { Heading } from '@/ui/Heading';
|
||||
import { Grid } from '@/ui/Grid';
|
||||
import { GridItem } from '@/ui/GridItem';
|
||||
import { Surface } from '@/ui/Surface';
|
||||
import { Input } from '@/ui/Input';
|
||||
import { Link } from '@/ui/Link';
|
||||
import { Skeleton } from '@/ui/Skeleton';
|
||||
import { LoadingSpinner } from '@/ui/LoadingSpinner';
|
||||
import { Badge } from '@/ui/Badge';
|
||||
|
||||
import { ProgressLine } from '@/ui/ProgressLine';
|
||||
|
||||
export {
|
||||
Pagination as SharedPagination,
|
||||
Text as SharedText,
|
||||
Box as SharedBox,
|
||||
Stack as SharedStack,
|
||||
Container as SharedContainer,
|
||||
ConfirmDialog as SharedConfirmDialog,
|
||||
Button as SharedButton,
|
||||
Icon as SharedIcon,
|
||||
Card as SharedCard,
|
||||
Heading as SharedHeading,
|
||||
Grid as SharedGrid,
|
||||
GridItem as SharedGridItem,
|
||||
Surface as SharedSurface,
|
||||
Input as SharedInput,
|
||||
Link as SharedLink,
|
||||
Skeleton as SharedSkeleton,
|
||||
LoadingSpinner as SharedLoadingSpinner,
|
||||
Badge as SharedBadge,
|
||||
ProgressLine as SharedProgressLine
|
||||
};
|
||||
@@ -40,7 +40,7 @@ export interface PageWrapperProps<TData> {
|
||||
/** Retry function for errors */
|
||||
retry?: () => void;
|
||||
/** Template component that receives the data */
|
||||
Template: React.ComponentType<{ data: TData }>;
|
||||
Template: React.ComponentType<{ viewData: TData }>;
|
||||
/** Loading configuration */
|
||||
loading?: PageWrapperLoadingConfig;
|
||||
/** Error configuration */
|
||||
@@ -162,7 +162,7 @@ export function PageWrapper<TData>({
|
||||
// 4. Success State - Render Template with data
|
||||
return (
|
||||
<React.Fragment>
|
||||
<Template data={data} />
|
||||
<Template viewData={data} />
|
||||
{children}
|
||||
</React.Fragment>
|
||||
);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
'use client';
|
||||
|
||||
import React from 'react';
|
||||
import { PageWrapper, PageWrapperProps } from '@/ui/PageWrapper';
|
||||
import { PageWrapper, PageWrapperProps } from './PageWrapper';
|
||||
|
||||
/**
|
||||
* Stateful Page Wrapper - CLIENT SIDE ONLY
|
||||
@@ -56,4 +56,4 @@ export function StatefulPageWrapper<TData>({
|
||||
}
|
||||
|
||||
// Re-export types for convenience
|
||||
export type { PageWrapperProps, PageWrapperLoadingConfig, PageWrapperErrorConfig, PageWrapperEmptyConfig } from '@/ui/PageWrapper';
|
||||
export type { PageWrapperProps, PageWrapperLoadingConfig, PageWrapperErrorConfig, PageWrapperEmptyConfig } from './PageWrapper';
|
||||
|
||||
Reference in New Issue
Block a user