Update : variants on badges and centers column headers

This commit is contained in:
percyfikri 2024-10-31 09:50:31 +07:00
parent 1eb355bf95
commit 491b04f607
2 changed files with 7 additions and 5 deletions

View File

@ -23,7 +23,7 @@ export default function DashboardTable<T>({ table }: Props<T>) {
{headerGroup.headers.map((header) => (
<TableHead
key={header.id}
className="px-6 py-3 text-left text-sm font-medium text-muted-foreground"
className={`px-6 py-3 text-left text-sm font-medium text-muted-foreground ${header.column.columnDef.header === 'Status' ? 'text-center' : ''}`}
style={{
maxWidth: `${header.column.columnDef.maxSize}px`,
width: `${header.getSize()}`,

View File

@ -17,10 +17,12 @@ const badgeVariants = cva(
outline: "text-foreground",
// Custom variants for status
waiting: "border-transparent bg-yellow-500 text-white hover:bg-yellow-600 px-2 py-1 text-[12px]",
accepted: "border-transparent bg-green-500 text-white hover:bg-green-600 px-11 py-1 text-[14px]",
rejected: "border-transparent bg-red-500 text-white hover:bg-red-600 px-12 py-1 text-[14px]",
completed: "border-transparent bg-blue-500 text-white hover:bg-blue-600 px-12 py-1 text-[14px]",
inprogress: "border-yellow-500 border-2 bg-yellow-300 px-6 py-1.5 text-[12px]",
waiting: "border-yellow-400 border-2 bg-yellow-200 px-3 py-1.5 text-[12px]",
accepted: "border-green-500 border-2 bg-green-200 px-12 py-1.5 text-[12px]",
rejected: "border-red-500 border-2 bg-red-200 px-14 py-1.5 text-[12px]",
unverified: "border-orange-400 border-2 bg-orange-200 px-6 py-1.5 text-[12px]",
completed: "border-blue-500 border-2 bg-blue-200 px-14 py-1.5 text-[12px]",
},
},
defaultVariants: {