| 1 |
import React from "react"; |
| 2 |
import { decodeEntities } from "@wordpress/html-entities"; |
| 3 |
import useFetch from "../hooks/useFetch"; |
| 4 |
|
| 5 |
const DocCategory = ({ categories }) => { |
| 6 |
return ( |
| 7 |
<span className="betterdocs-dashboard-list-item-category"> |
| 8 |
{categories.map((category, index) => ( |
| 9 |
<React.Fragment key={index}> |
| 10 |
<a href={category.term_url}>{decodeEntities(category.term_name)}</a> |
| 11 |
{index < categories.length - 1 && ", "} |
| 12 |
</React.Fragment> |
| 13 |
))} |
| 14 |
</span> |
| 15 |
); |
| 16 |
}; |
| 17 |
|
| 18 |
export default DocCategory; |
| 19 |
|