import { TimelinePropsItem } from '@/src/types/timeline';

export const getItemKey = (index: number, itemKeys: Record<number, string>) => {
  if (!itemKeys[index]) {
    itemKeys[index] = crypto.randomUUID();
  }
  return itemKeys[index];
};

export const getBulletKey = (itemIndex: number, bulletIndex: number, bulletKeys: Record<string, string>) => {
  const compositeKey = `${itemIndex}-${bulletIndex}`;
  if (!bulletKeys[compositeKey]) {
    bulletKeys[compositeKey] = crypto.randomUUID();
  }
  return bulletKeys[compositeKey];
};

export const DEFAULT_ITEM: TimelinePropsItem = {
  date: 'New Date',
  position: 'New Position',
  company: 'New Company',
  icon: 'FaBriefcase',
  bullets: ['New bullet point'],
};
