feat: define Activity interface and centralize type exports for activity logs

This commit is contained in:
Yoga Pangestu 2026-04-22 20:35:04 +07:00
parent 26eaaf6d66
commit 37960a9dc5
4 changed files with 16 additions and 14 deletions

View File

@ -1,8 +1,8 @@
import { Head } from '@inertiajs/react';
import { Card, CardContent } from '@/components/ui/card';
import { DataTable } from '@/components/data-table';
import { useState } from 'react';
import { getColumns, Activity } from './partials/columns';
import { getColumns } from './partials/columns';
import { Activity } from '@/types';
interface Props {
activities: Activity[];
@ -37,6 +37,7 @@ export default function ActivityLogIndex({ activities }: Props) {
]
}
]}
showSelection={false}
/>
</CardContent>
</Card>

View File

@ -1,16 +1,6 @@
import { ColumnDef } from '@tanstack/react-table';
import { Badge } from '@/components/ui/badge';
export interface Activity {
id: number;
description: string;
module: string;
subject_id: number | string | null;
causer: string;
properties: any;
created_at: string;
date: string;
}
import { Activity } from '@/types';
export function getColumns(): ColumnDef<Activity>[] {
return [
@ -29,7 +19,7 @@ export function getColumns(): ColumnDef<Activity>[] {
header: 'Aksi',
cell: ({ row }) => {
const label = row.original.description;
if (label === 'TAMBAH') {
return (
<Badge className="bg-green-50 text-green-700 dark:bg-green-950 dark:text-green-300 uppercase text-[10px]">

View File

@ -0,0 +1,10 @@
export interface Activity {
id: number;
description: string;
module: string;
subject_id: number | string | null;
causer: string;
properties: any;
created_at: string;
date: string;
}

View File

@ -7,4 +7,5 @@ export type * from './expense';
export type * from './payroll';
export type * from './purchase';
export type * from './general-setting';
export type * from './activity';