export const Table = ({ heads, data, availableKeys }) => {
    return <table style={{ textAlign: 'left' }} border="1" cellPadding={"10"} width={"100%"}>
        <thead>
            <tr>
                {heads.map((head =>
                    <th className='list__td'>{head}</th>
                ))}
            </tr>
        </thead>
        <tbody>
            {data.map(serv => (
                <tr key={serv.id}>
                    {(availableKeys ?? Object.keys(serv)).map(key => <td className='list__td'>{serv[key]}</td>
                    )}
                </tr>
            )
            )
            }
        </tbody>
    </table>
}