tududi/frontend/components/Task/TimelinePanel.tsx
Chris 03f38f05dc
Setup intelligence (#84)
* Add next suggestions and remove console logs

* Add pomodoro timer

* Add pomodoro switch in settings

* Fix pomodoro setting

* Add timezones to settings

* Fix an issue with password reset

* Cleanup

* Sort tags alphabetically

* Clean up today's view

* Add an indicator for repeatedly added to today

* Refactor tags

* Add due date today item

* Move recurrence to the subtitle area

* Fix today layout

* Add a badge to Inbox items

* Move inbox badge to sidebar

* Add quotes and progress bar

* Add translations for quotes

* Fix test issues

* Add helper script for docker local

* Set up overdue tasks

* Add  linux/arm/v7 build to deploy script

* Add  linux/arm/v7 build to deploy script pt2

* Fix an issue with helmet and SSL

* Add volume db persistence

* Fix cog icon issues
2025-06-27 14:02:18 +03:00

62 lines
No EOL
2.1 KiB
TypeScript

import React from 'react';
import { useTranslation } from 'react-i18next';
import TaskTimeline from './TaskTimeline';
import { ClockIcon, XMarkIcon } from '@heroicons/react/24/outline';
interface TimelinePanelProps {
taskId: number | undefined;
isExpanded: boolean;
onToggle: () => void;
}
const TimelinePanel: React.FC<TimelinePanelProps> = ({
taskId,
isExpanded,
onToggle
}) => {
const { t } = useTranslation();
return (
<div className={`${
isExpanded
? 'w-full lg:w-80 opacity-100'
: 'w-0 lg:w-12 opacity-0 lg:opacity-100'
} border-t lg:border-t-0 lg:border-l border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900/50 flex flex-col transition-all duration-300 overflow-hidden`}>
{/* Collapsed state - envelope icon */}
{!isExpanded && (
<div className="hidden lg:flex flex-col items-center justify-center h-full p-2">
<span className="text-xs text-gray-500 dark:text-gray-400 mt-2 transform rotate-90 whitespace-nowrap">
{t('timeline.activityTimeline')}
</span>
</div>
)}
{/* Expanded state - full timeline */}
{isExpanded && (
<>
<div className="p-3 lg:p-4 border-b border-gray-200 dark:border-gray-700 flex-shrink-0">
<div className="flex items-center justify-between">
<h3 className="text-sm font-medium text-gray-900 dark:text-gray-100 flex items-center">
<ClockIcon className="h-4 w-4 mr-2 text-gray-500" />
{t('timeline.activityTimeline')}
</h3>
<button
onClick={() => onToggle()}
className="lg:hidden p-1 text-gray-600 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 rounded"
title={t('timeline.hideTimeline')}
>
<XMarkIcon className="h-4 w-4" />
</button>
</div>
</div>
<div className="p-3 lg:p-4 flex-1 overflow-hidden">
<TaskTimeline taskId={taskId} />
</div>
</>
)}
</div>
);
};
export default TimelinePanel;