Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

539 B
Raw Blame
import { Text } from '@lobehub/ui';
import { memo } from 'react';

import { useActivityTime } from '@/hooks/useActivityTime';

interface TimeProps {
  capturedAt?: Date | number | string;
}

const Time = memo<TimeProps>(({ capturedAt }) => {
  const { text, title } = useActivityTime(capturedAt);
  if (!text) return null;

  return (
    <Text
      as={'time'}
      fontSize={12}
      style={{ display: 'block', flex: 'none' }}
      title={title}
      type={'secondary'}
    >
      {text}
    </Text>
  );
});

export default Time;