import ListBio from '../data/Biograph.json';

export interface BioInfo {
    id: number;
    title: string;
    tags: string;
    birth: string,
    place: string,
    death: string,
    photo: string;
    content: string;
    Text: string;
    continue: string;
    url: string;
}

export const getMessages = () => ListBio;

export const getMessage = (id: number) => ListBio.find(m => m.id === id);

export function getBioInfoPhoto (id: number) {
    const bio = ListBio.find(bio => bio.id === id);

    if (bio) {
        return bio.photo;
    }
    return undefined;
}