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.
58 lines
2.0 KiB
TypeScript
58 lines
2.0 KiB
TypeScript
import React from 'react';
|
|
import { useLiveActivity } from '@/hooks/features/useLiveActivity.ts';
|
|
import { useTranslation } from '@/hooks/useI18n.tsx';
|
|
import { Organization } from '@/types.ts';
|
|
import SectionHeader from '@/components/layout/SectionHeader.tsx';
|
|
import { Container, Stack } from '@/components/ui/layout';
|
|
import ActivityItem from '@/components/landing/ActivityItem.tsx';
|
|
import ActivityItemSkeleton from '@/components/landing/ActivityItemSkeleton.tsx';
|
|
|
|
interface LiveActivityProps {
|
|
onViewOrganization: (org: Organization) => void;
|
|
organizations: Organization[];
|
|
}
|
|
|
|
const LiveActivity = ({ onViewOrganization, organizations }: LiveActivityProps) => {
|
|
const { t } = useTranslation();
|
|
const { activitiesWithOrgs, isLoading } = useLiveActivity(organizations);
|
|
|
|
// Hide section completely if no activities and not loading
|
|
if (!isLoading && activitiesWithOrgs.length === 0) {
|
|
return null;
|
|
}
|
|
|
|
return (
|
|
<section className="bg-muted/50 scroll-snap-align-start" aria-labelledby="live-activity-title">
|
|
<Container size="md" className="py-16 sm:py-24 w-full">
|
|
<SectionHeader
|
|
id="live-activity-title"
|
|
title={t('liveActivity.title')}
|
|
className="mb-10 sm:mb-12"
|
|
/>
|
|
<div className="flow-root">
|
|
{isLoading ? (
|
|
<Stack spacing="none" className="-my-4">
|
|
{Array.from({ length: 3 }).map((_, index) => (
|
|
<ActivityItemSkeleton key={index} isLastItem={index === 2} />
|
|
))}
|
|
</Stack>
|
|
) : (
|
|
<Stack spacing="none" className="-my-4">
|
|
{activitiesWithOrgs.map((activity, index) => (
|
|
<ActivityItem
|
|
key={`${activity.org.id}-${index}`}
|
|
activity={activity}
|
|
onViewOrganization={onViewOrganization}
|
|
isLastItem={index === activitiesWithOrgs.length - 1}
|
|
/>
|
|
))}
|
|
</Stack>
|
|
)}
|
|
</div>
|
|
</Container>
|
|
</section>
|
|
);
|
|
};
|
|
|
|
export default React.memo(LiveActivity);
|