Skip to content

Commit

Permalink
fix: docs: fix styling and usage of default components in the network…
Browse files Browse the repository at this point in the history
… documentation.
  • Loading branch information
brnovasco committed May 23, 2024
1 parent c9b4e78 commit c914e1a
Show file tree
Hide file tree
Showing 3 changed files with 270 additions and 144 deletions.
33 changes: 33 additions & 0 deletions apps/docs/app/_components/ui/pros-and-cons-table.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import * as React from "react";
import { cn } from "@/app/lib/utils";

type ProsConsProps = {
pros: string[];
cons: string[];
className?: string;
};
const ProsAndConsTable = React.forwardRef<HTMLTableElement, ProsConsProps>(
({ pros, cons, className }, ref) => {
const maxRows = Math.max(pros.length, cons.length);
return (
<table ref={ref} className={cn("w-full table-fixed", className)}>
<thead>
<tr>
<th>Pros</th>
<th>Cons</th>
</tr>
</thead>
<tbody>
{Array.from({ length: maxRows }).map((_, index) => (
<tr key={index} className="flex-wrap">
<td className="text-wrap">{pros[index]}</td>
<td className="text-wrap">{cons[index]}</td>
</tr>
))}
</tbody>
</table>
);
}
);

export { ProsAndConsTable };
Loading

0 comments on commit c914e1a

Please sign in to comment.