export interface Banner {
    id: number | null,
    image: string,
    banner_position: string,
    link_type: number | null,
    value: string
}

export const useBannerStore = defineStore('banner', {
    state: () => ({
        list: [] as Banner[],
        selected: null as Banner | null
    }),
    actions: {
        setSelected(banner: Banner) {
            this.selected = banner;
        },

        getById(id: number) {
            return this.list.find(b => b.id === id) || null;
        }
    }
})