interface Props {
    map(arg0: (rows: any) => string): unknown;
    title: string,
    atom_link: string,
    email: string,
    nameCompanies: string,
    description: string,
    webSite: string,
    urlImg: string,
    lastBuildDate: string
}

export const getRssXml = (data: Props) => {
        let item =`<?xml version="1.0" encoding="UTF-8"?>
        <rss xmlns:dc="http://purl.org/dc/elements/1.1/" 
            xmlns:content="http://purl.org/rss/1.0/modules/content/" 
            xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" 
            xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" >
        <channel>
        <title><![CDATA[`+data.title+`]]></title>
        <description><![CDATA[`+data.description+`]]></description>
        <link>`+data.atom_link+`</link>
        <image>
            <url>`+data.webSite+'/img/'+data.urlImg+`</url>
            <title>`+data.title+`</title>
            <link>`+data.atom_link+`</link>
        </image>
        <generator>krasnikov podcasts</generator>
        <lastBuildDate>`+data.lastBuildDate+`</lastBuildDate>
        <pubDate>`+data.lastBuildDate+`</pubDate>
        <copyright><![CDATA[2023 © `+data.nameCompanies+`. Все права защищены.]]></copyright>
        <language><![CDATA[ru]]></language>
        <itunes:type>episodic</itunes:type>
        <itunes:explicit>no</itunes:explicit>
        <itunes:author>`+data.nameCompanies+`</itunes:author>
        <itunes:summary>`+data.description+`</itunes:summary>
        <itunes:owner>
            <itunes:name>`+data.nameCompanies+`</itunes:name>
            <itunes:email>crapsh@gmail.com</itunes:email>
        </itunes:owner>
        <itunes:image href="`+data.webSite+'/img/'+data.urlImg+`"/>
        <itunes:category text="Education">
            <itunes:category text="Self-Improvement"/>
        </itunes:category>
        <itunes:category text="Business">
            <itunes:category text="Careers"/>
            </itunes:category>
            <itunes:category text="Science">
                <itunes:category text="Social Sciences"/>
        </itunes:category>`;
      return(item)
};

