mirror of
https://github.com/SamyRai/turash.git
synced 2025-12-26 23:01:33 +00:00
- Remove nested git repository from bugulma/frontend/.git - Add all frontend files to main repository tracking - Convert from separate frontend/backend repos to unified monorepo - Preserve all frontend code and development history as tracked files - Eliminate nested repository complexity for simpler development workflow This creates a proper monorepo structure with frontend and backend coexisting in the same repository for easier development and deployment.
67 lines
1.8 KiB
TypeScript
67 lines
1.8 KiB
TypeScript
import React from 'react';
|
|
import Button from '@/components/ui/Button.tsx';
|
|
import Skeleton from '@/components/ui/Skeleton.tsx';
|
|
import ErrorMessage from '@/components/ui/ErrorMessage.tsx';
|
|
|
|
interface IntelligenceModuleProps {
|
|
title?: string;
|
|
description: string;
|
|
buttonText: string;
|
|
onAction: () => void;
|
|
isPending: boolean;
|
|
error: string | null;
|
|
children?: React.ReactNode;
|
|
size?: 'default' | 'small';
|
|
}
|
|
|
|
const IntelligenceModule = ({
|
|
title,
|
|
description,
|
|
buttonText,
|
|
onAction,
|
|
isPending,
|
|
error,
|
|
children,
|
|
size = 'default',
|
|
}: IntelligenceModuleProps) => {
|
|
const titleClass = size === 'small' ? 'text-sm font-semibold' : 'text-base font-semibold';
|
|
const descriptionClass =
|
|
size === 'small' ? 'text-xs text-muted-foreground mb-3' : 'text-sm text-muted-foreground';
|
|
const buttonSize = size === 'small' ? 'sm' : 'default';
|
|
|
|
if (isPending) {
|
|
if (size === 'small') {
|
|
return (
|
|
<div className="space-y-2 text-left">
|
|
<Skeleton className="h-4 w-3/4" />
|
|
<Skeleton className="h-3 w-full" />
|
|
<Skeleton className="h-3 w-5/6" />
|
|
<Skeleton className="h-8 w-full mt-2" />
|
|
</div>
|
|
);
|
|
}
|
|
return (
|
|
<div className="space-y-3">
|
|
<Skeleton className="h-5 w-3/4 mx-auto" />
|
|
<Skeleton className="h-4 w-full" />
|
|
<Skeleton className="h-4 w-5/6 mx-auto" />
|
|
<Skeleton className="h-10 w-full mt-2" />
|
|
</div>
|
|
);
|
|
}
|
|
|
|
return (
|
|
<div className="text-center">
|
|
{title && <p className={titleClass}>{title}</p>}
|
|
<p className={descriptionClass}>{description}</p>
|
|
<Button size={buttonSize} onClick={onAction} disabled={isPending} className="w-full">
|
|
{buttonText}
|
|
</Button>
|
|
{error && <ErrorMessage message={error} className="mt-2" />}
|
|
{children}
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default React.memo(IntelligenceModule);
|