Commit 3e4c052f authored by Steven's avatar Steven

chore: unify table style

parent 4321887a
...@@ -7,7 +7,7 @@ interface TableProps extends React.HTMLAttributes<HTMLTableElement>, ReactMarkdo ...@@ -7,7 +7,7 @@ interface TableProps extends React.HTMLAttributes<HTMLTableElement>, ReactMarkdo
export const Table = ({ children, className, node: _node, ...props }: TableProps) => { export const Table = ({ children, className, node: _node, ...props }: TableProps) => {
return ( return (
<div className="w-full overflow-x-auto rounded-lg border border-border my-2"> <div className="my-2 w-full overflow-x-auto rounded-lg border border-border bg-muted/20">
<table className={cn("w-full border-collapse text-sm", className)} {...props}> <table className={cn("w-full border-collapse text-sm", className)} {...props}>
{children} {children}
</table> </table>
...@@ -21,7 +21,7 @@ interface TableHeadProps extends React.HTMLAttributes<HTMLTableSectionElement>, ...@@ -21,7 +21,7 @@ interface TableHeadProps extends React.HTMLAttributes<HTMLTableSectionElement>,
export const TableHead = ({ children, className, node: _node, ...props }: TableHeadProps) => { export const TableHead = ({ children, className, node: _node, ...props }: TableHeadProps) => {
return ( return (
<thead className={cn("bg-accent/50", className)} {...props}> <thead className={cn("border-b border-border bg-muted/30", className)} {...props}>
{children} {children}
</thead> </thead>
); );
...@@ -45,7 +45,7 @@ interface TableRowProps extends React.HTMLAttributes<HTMLTableRowElement>, React ...@@ -45,7 +45,7 @@ interface TableRowProps extends React.HTMLAttributes<HTMLTableRowElement>, React
export const TableRow = ({ children, className, node: _node, ...props }: TableRowProps) => { export const TableRow = ({ children, className, node: _node, ...props }: TableRowProps) => {
return ( return (
<tr className={cn("transition-colors hover:bg-muted/30", className)} {...props}> <tr className={cn("transition-colors hover:bg-accent/20", className)} {...props}>
{children} {children}
</tr> </tr>
); );
...@@ -57,14 +57,7 @@ interface TableHeaderCellProps extends React.ThHTMLAttributes<HTMLTableCellEleme ...@@ -57,14 +57,7 @@ interface TableHeaderCellProps extends React.ThHTMLAttributes<HTMLTableCellEleme
export const TableHeaderCell = ({ children, className, node: _node, ...props }: TableHeaderCellProps) => { export const TableHeaderCell = ({ children, className, node: _node, ...props }: TableHeaderCellProps) => {
return ( return (
<th <th className={cn("px-2 py-1 text-left align-middle text-sm font-medium text-muted-foreground", className)} {...props}>
className={cn(
"px-3 py-2 text-left text-xs font-semibold uppercase tracking-wider text-muted-foreground",
"border-b-2 border-border",
className,
)}
{...props}
>
{children} {children}
</th> </th>
); );
...@@ -76,7 +69,7 @@ interface TableCellProps extends React.TdHTMLAttributes<HTMLTableCellElement>, R ...@@ -76,7 +69,7 @@ interface TableCellProps extends React.TdHTMLAttributes<HTMLTableCellElement>, R
export const TableCell = ({ children, className, node: _node, ...props }: TableCellProps) => { export const TableCell = ({ children, className, node: _node, ...props }: TableCellProps) => {
return ( return (
<td className={cn("px-3 py-2 text-left", className)} {...props}> <td className={cn("px-2 py-1 text-left align-middle text-sm", className)} {...props}>
{children} {children}
</td> </td>
); );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment