import { Button } from '@/components/ui/button';
import { TimelineItemSummaryProps } from '@/src/types/timeline';
import { Trash2 } from 'lucide-react';

export function TimelineItemSummary({ item, onEdit, onRemove }: TimelineItemSummaryProps) {
  return (
    <div className='flex items-center justify-between'>
      <div>
        <div className='flex items-center gap-2'>
          <div>
            <h3 className='font-medium'>{item.position}</h3>
            <p className='text-sm text-neutral-700'>{item.company}</p>
          </div>
        </div>
        {item.bullets.length > 0 && (
          <p className='text-xs text-neutral-600 mt-2 line-clamp-1'>
            {item.bullets.length} bullet point{item.bullets.length > 1 ? 's' : ''}
          </p>
        )}
      </div>
      <div className='space-x-2 flex flex-row'>
        <Button size='sm' variant='ghost' onClick={onEdit}>
          Edit
        </Button>
        <Button size='sm' variant='ghost' className='text-neutral-800' onClick={onRemove}>
          <Trash2 className='h-4 w-4' />
        </Button>
      </div>
    </div>
  );
}
