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.
51 lines
1.8 KiB
TypeScript
51 lines
1.8 KiB
TypeScript
import React, { useCallback } from 'react';
|
|
import { Organization, LiveActivity as LiveActivityType } from '@/types.ts';
|
|
import { useTranslation } from '@/hooks/useI18n.tsx';
|
|
|
|
type ActivityWithOrg = LiveActivityType & { org: Organization };
|
|
|
|
interface ActivityItemProps {
|
|
activity: ActivityWithOrg;
|
|
onViewOrganization: (org: Organization) => void;
|
|
isLastItem: boolean;
|
|
}
|
|
|
|
const ActivityItem: React.FC<ActivityItemProps> = ({
|
|
activity,
|
|
onViewOrganization,
|
|
isLastItem,
|
|
}) => {
|
|
const { t } = useTranslation();
|
|
|
|
const handleClick = useCallback(() => {
|
|
onViewOrganization(activity.org);
|
|
}, [onViewOrganization, activity.org]);
|
|
|
|
return (
|
|
<div className="relative pl-16 py-4">
|
|
{!isLastItem && (
|
|
<span className="absolute left-6 top-6 -ml-px h-full w-0.5 bg-border" aria-hidden="true" />
|
|
)}
|
|
<div className="relative flex items-center gap-4">
|
|
<div className="absolute left-0 top-1/2 -translate-y-1/2 z-10 flex h-12 w-12 flex-none items-center justify-center rounded-full bg-background ring-2">
|
|
{React.cloneElement(activity.icon, { className: 'h-6 w-6 text-primary' })}
|
|
</div>
|
|
<div
|
|
onClick={handleClick}
|
|
className="flex-auto rounded-lg p-4 cursor-pointer bg-background/50 border border-transparent hover:bg-background transition-all shadow-sm hover:shadow-lg"
|
|
>
|
|
<p className="text-base text-foreground">
|
|
<span className="font-semibold">{activity.org.name}</span> {t(activity.actionKey)}{' '}
|
|
{activity.subjectKey && <span className="font-semibold">{t(activity.subjectKey)}</span>}
|
|
</p>
|
|
<p className="text-sm text-muted-foreground">
|
|
{t(activity.timeKey, { count: activity.timeValue })}
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default React.memo(ActivityItem);
|