This repository has been archived on 2026-01-31. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
nextjs-serve-actions/app/components/Dashboard/Items/ItemsTableRow.tsx
2024-05-23 16:55:29 +02:00

27 lines
764 B
TypeScript

import { TableCell, TableRow } from '@mui/material';
import { Item } from '../../../../data/types';
interface ItemsTableRowProps {
item: Item;
onClick: (item: Item) => void;
}
export default function ItemsTableRow({ item, onClick }: ItemsTableRowProps) {
return (
<TableRow
sx={{ '& td': { textAlign: 'center' } }}
key={item.id}
onClick={() => onClick(item)}
>
<TableCell>{item.name}</TableCell>
<TableCell>{item.description}</TableCell>
<TableCell>{Number(item.price).toFixed(2)}</TableCell>
<TableCell>{item.currency}</TableCell>
<TableCell>{item.tag}</TableCell>
<TableCell>
{item.createdAt && new Date(item.createdAt).toLocaleDateString()}
</TableCell>
</TableRow>
);
}