export const sortEntriesByLabel = (entries = []) => {
  return [...entries].sort((a, b) => {
    const labelA = (a?.label || '').trim();
    const labelB = (b?.label || '').trim();
    if (!labelA && !labelB) {
      return 0;
    }
    if (!labelA) {
      return 1;
    }
    if (!labelB) {
      return -1;
    }
    return labelA.localeCompare(labelB, 'de', { sensitivity: 'base' });
  });
};
