Skip to content

Commit

Permalink
Hide empty datasheets
Browse files Browse the repository at this point in the history
  • Loading branch information
maksz42 authored and yaqwsx committed Feb 18, 2024
1 parent 039b07d commit 1a41275
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions web/src/componentTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -333,21 +333,26 @@ export class ComponentOverview extends React.Component {

let header = [
{
name: "MFR (click for datasheet)",
name: "MFR",
sortable: true,
displayGetter: x => <>
<CopyToClipboard text={x.mfr}>
<button className="py-2 px-4 pl-1" onClick={e => e.stopPropagation()}>
<FontAwesomeIcon icon="clipboard"/>
</button>
</CopyToClipboard>
<a
href={x.datasheet}
onClick={e => e.stopPropagation()}
target="_blank"
rel="noopener noreferrer">
<FontAwesomeIcon icon="file-pdf"/> {x.mfr}
</a>
{x.datasheet ? (
<a
href={x.datasheet}
className="underline text-blue-600"
onClick={e => e.stopPropagation()}
target="_blank"
rel="noopener noreferrer">
<FontAwesomeIcon icon="file-pdf"/> {x.mfr}
</a>
) : (
x.mfr
)}
</>,
comparator: (a, b) => naturalCompare(a.mfr, b.mfr),
className: "px-1 whitespace-no-wrap"
Expand Down

0 comments on commit 1a41275

Please sign in to comment.