website refactor
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import React, { ReactNode } from 'react';
|
||||
import React, { ReactNode, CSSProperties } from 'react';
|
||||
import { Surface } from './Surface';
|
||||
|
||||
export interface TableProps {
|
||||
@@ -16,7 +16,14 @@ export const Table = ({ children, className }: TableProps) => {
|
||||
);
|
||||
};
|
||||
|
||||
export const TableHeader = ({ children, className, textAlign, w }: { children: ReactNode, className?: string, textAlign?: 'left' | 'center' | 'right', w?: string }) => {
|
||||
export interface TableHeaderProps {
|
||||
children: ReactNode;
|
||||
className?: string;
|
||||
textAlign?: 'left' | 'center' | 'right';
|
||||
w?: string;
|
||||
}
|
||||
|
||||
export const TableHeader = ({ children, className, textAlign, w }: TableHeaderProps) => {
|
||||
return (
|
||||
<thead className={`bg-[var(--ui-color-bg-base)] border-b border-[var(--ui-color-border-default)] ${className || ''}`}>
|
||||
<tr>
|
||||
@@ -55,7 +62,14 @@ export const TableRow = ({ children, onClick, className, variant, clickable, bg,
|
||||
);
|
||||
};
|
||||
|
||||
export const TableHeaderCell = ({ children, textAlign, w, className }: { children: ReactNode, textAlign?: 'left' | 'center' | 'right', w?: string, className?: string }) => {
|
||||
export interface TableHeaderCellProps {
|
||||
children: ReactNode;
|
||||
textAlign?: 'left' | 'center' | 'right';
|
||||
w?: string;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
export const TableHeaderCell = ({ children, textAlign, w, className }: TableHeaderCellProps) => {
|
||||
const alignClass = textAlign === 'center' ? 'text-center' : (textAlign === 'right' ? 'text-right' : 'text-left');
|
||||
return (
|
||||
<th
|
||||
@@ -67,7 +81,18 @@ export const TableHeaderCell = ({ children, textAlign, w, className }: { childre
|
||||
);
|
||||
};
|
||||
|
||||
export const TableCell = ({ children, textAlign, className, py, colSpan, w, position, ...props }: { children: ReactNode, textAlign?: 'left' | 'center' | 'right', className?: string, py?: number, colSpan?: number, w?: string, position?: string, [key: string]: any }) => {
|
||||
export interface TableCellProps {
|
||||
children: ReactNode;
|
||||
textAlign?: 'left' | 'center' | 'right';
|
||||
className?: string;
|
||||
py?: number;
|
||||
colSpan?: number;
|
||||
w?: string;
|
||||
position?: string;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
export const TableCell = ({ children, textAlign, className, py, colSpan, w, position, ...props }: TableCellProps) => {
|
||||
const alignClass = textAlign === 'center' ? 'text-center' : (textAlign === 'right' ? 'text-right' : 'text-left');
|
||||
return (
|
||||
<td
|
||||
|
||||
Reference in New Issue
Block a user