// Feuerwehr-Signaturen nach Schweizer Standard (FKS/BABS)
// Icons are now loaded from public/signaturen/ via the database (seed.js)
// This file is kept for backward compatibility with old saved features

export interface FWSymbol {
  id: string
  name: string
  category: string
  svg: string
}

export interface FWCategory {
  id: string
  name: string
  symbols: FWSymbol[]
}

const svgToDataUri = (svg: string): string => {
  return `data:image/svg+xml;charset=utf-8,${encodeURIComponent(svg)}`
}

// All symbols are now served from the database / public/signaturen/
export const fwCategories: FWCategory[] = []

export function getSymbolById(id: string): FWSymbol | undefined {
  for (const cat of fwCategories) {
    const found = cat.symbols.find((s) => s.id === id)
    if (found) return found
  }
  return undefined
}

export function getSymbolDataUri(symbol: FWSymbol): string {
  return svgToDataUri(symbol.svg)
}
