fix: remove truncation from description display in various components
This commit is contained in:
parent
3fe74bf166
commit
175decfa22
@ -120,7 +120,7 @@ export function createTransactionColumns(
|
||||
accessorKey: 'description',
|
||||
header: () => <span>Keterangan</span>,
|
||||
cell: ({ row }) => (
|
||||
<span className="block max-w-[200px] truncate">
|
||||
<span className="block max-w-[200px]">
|
||||
{row.getValue('description') as string}
|
||||
</span>
|
||||
),
|
||||
|
||||
@ -17,6 +17,7 @@ export type EmployeeAdvance = {
|
||||
formatted_created_at: string;
|
||||
employee: {
|
||||
user: {
|
||||
id: number;
|
||||
user_profile: {
|
||||
full_name: string;
|
||||
};
|
||||
@ -63,12 +64,13 @@ type CreateColumnsParams = {
|
||||
handleApprove: (employeeAdvance: EmployeeAdvance) => void;
|
||||
handlePay: (employeeAdvance: EmployeeAdvance) => void;
|
||||
can: (permission: string) => boolean;
|
||||
authUserId: number;
|
||||
};
|
||||
|
||||
export function createEmployeeAdvanceColumns(
|
||||
params: CreateColumnsParams,
|
||||
): ColumnDef<EmployeeAdvance>[] {
|
||||
const { handleEdit, handleDeleteClick, handleApprove, handlePay, can } =
|
||||
const { handleEdit, handleDeleteClick, handleApprove, handlePay, can, authUserId } =
|
||||
params;
|
||||
|
||||
return [
|
||||
@ -162,7 +164,10 @@ export function createEmployeeAdvanceColumns(
|
||||
{
|
||||
label: 'Edit',
|
||||
icon: <Pencil className="h-4 w-4" />,
|
||||
show: can('employee_advances.update'),
|
||||
show:
|
||||
can('employee_advances.update') &&
|
||||
employeeAdvance.status === 'pending' &&
|
||||
employeeAdvance.employee?.user?.id === authUserId,
|
||||
onClick: () => handleEdit(employeeAdvance),
|
||||
},
|
||||
{
|
||||
@ -170,7 +175,10 @@ export function createEmployeeAdvanceColumns(
|
||||
icon: (
|
||||
<Trash2 className="h-4 w-4 text-destructive" />
|
||||
),
|
||||
show: can('employee_advances.delete'),
|
||||
show:
|
||||
can('employee_advances.delete') &&
|
||||
employeeAdvance.status === 'pending' &&
|
||||
employeeAdvance.employee?.user?.id === authUserId,
|
||||
onClick: () =>
|
||||
handleDeleteClick(employeeAdvance),
|
||||
},
|
||||
|
||||
@ -42,7 +42,7 @@ export function createExpenseColumns(
|
||||
accessorKey: 'description',
|
||||
header: () => <span>Keterangan</span>,
|
||||
cell: ({ row }) => (
|
||||
<span className="block max-w-[200px] truncate">
|
||||
<span className="block max-w-[200px]">
|
||||
{row.getValue('description') as string}
|
||||
</span>
|
||||
),
|
||||
|
||||
@ -182,7 +182,7 @@ export function createPayrollColumns(
|
||||
{adj.type === 'bonus' ? '+' : '-'}{' '}
|
||||
{formatCurrency(adj.amount)}
|
||||
</span>
|
||||
<span className="max-w-[100px] truncate text-muted-foreground">
|
||||
<span className="max-w-[100px] text-muted-foreground">
|
||||
{adj.description}
|
||||
</span>
|
||||
{payroll.status === 'unpaid' && (
|
||||
|
||||
@ -41,7 +41,7 @@ export function createCustomerColumns(
|
||||
accessorKey: 'address',
|
||||
header: () => <span>Alamat</span>,
|
||||
cell: ({ row }) => (
|
||||
<span className="block max-w-[200px] truncate">
|
||||
<span className="block max-w-[200px]">
|
||||
{(row.getValue('address') as string) ?? '-'}
|
||||
</span>
|
||||
),
|
||||
|
||||
@ -41,7 +41,7 @@ export function createSupplierColumns(
|
||||
accessorKey: 'address',
|
||||
header: () => <span>Alamat</span>,
|
||||
cell: ({ row }) => (
|
||||
<span className="block max-w-[200px] truncate">
|
||||
<span className="block max-w-[200px]">
|
||||
{(row.getValue('address') as string) ?? '-'}
|
||||
</span>
|
||||
),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user