mirror of
https://github.com/hex248/sprint.git
synced 2026-02-08 02:33:01 +00:00
added issueSelectAction to IssuesTable
This commit is contained in:
@@ -4,9 +4,11 @@ import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@
|
|||||||
export function IssuesTable({
|
export function IssuesTable({
|
||||||
issues,
|
issues,
|
||||||
columns = {},
|
columns = {},
|
||||||
|
issueSelectAction,
|
||||||
}: {
|
}: {
|
||||||
issues: IssueRecord[];
|
issues: IssueRecord[];
|
||||||
columns?: { id?: boolean; title?: boolean; description?: boolean; assignee?: boolean };
|
columns?: { id?: boolean; title?: boolean; description?: boolean; assignee?: boolean };
|
||||||
|
issueSelectAction?: (issue: IssueRecord) => void;
|
||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<Table>
|
<Table>
|
||||||
@@ -25,7 +27,13 @@ export function IssuesTable({
|
|||||||
</TableHeader>
|
</TableHeader>
|
||||||
<TableBody>
|
<TableBody>
|
||||||
{issues.map((issue) => (
|
{issues.map((issue) => (
|
||||||
<TableRow key={issue.id} className="cursor-pointer">
|
<TableRow
|
||||||
|
key={issue.id}
|
||||||
|
className="cursor-pointer"
|
||||||
|
onClick={() => {
|
||||||
|
issueSelectAction?.(issue);
|
||||||
|
}}
|
||||||
|
>
|
||||||
{(columns.id == null || columns.id === true) && (
|
{(columns.id == null || columns.id === true) && (
|
||||||
<TableCell className="font-medium border-r">
|
<TableCell className="font-medium border-r">
|
||||||
{String(issue.id).padStart(3, "0")}
|
{String(issue.id).padStart(3, "0")}
|
||||||
|
|||||||
Reference in New Issue
Block a user