• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

cartesi / rollups-explorer / 9252364236

27 May 2024 09:13AM CUT coverage: 93.272% (-0.8%) from 94.07%
9252364236

Pull #161

github

dandheedge
fix(packages/decoder): change env for provider
Pull Request #161: #156 Voucher content decoding

759 of 894 branches covered (84.9%)

Branch coverage included in aggregate %.

48 of 133 new or added lines in 3 files covered. (36.09%)

8404 of 8930 relevant lines covered (94.11%)

55.01 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

73.27
/apps/web/src/components/applications/applicationsTable.tsx
1
"use client";
1✔
2

1✔
3
import {
1✔
4
    Loader,
1✔
5
    Table,
1✔
6
    Text,
1✔
7
    Transition,
1✔
8
    useMantineColorScheme,
1✔
9
    useMantineTheme,
1✔
10
} from "@mantine/core";
1✔
11
import { FC, useRef } from "react";
1✔
12
import { ApplicationItemFragment } from "../../graphql/explorer/operations";
1✔
13
import { Application } from "../../graphql/explorer/types";
1✔
14
import ApplicationRow from "./applicationRow";
1✔
15
import { useElementVisibility } from "../../hooks/useElementVisibility";
1✔
16
import TableResponsiveWrapper from "../tableResponsiveWrapper";
1✔
17

1✔
18
export interface ApplicationsTableProps {
1✔
19
    applications: ApplicationItemFragment[];
1✔
20
    fetching: boolean;
1✔
21
    totalCount: number;
1✔
22
}
1✔
23

1✔
24
const ApplicationsTable: FC<ApplicationsTableProps> = (props) => {
1✔
25
    const { applications, fetching, totalCount } = props;
5✔
26
    const tableRowRef = useRef<HTMLDivElement>(null);
5✔
27
    const theme = useMantineTheme();
5✔
28
    const { colorScheme } = useMantineColorScheme();
5✔
29
    const bgColor = colorScheme === "dark" ? theme.colors.dark[7] : theme.white;
5!
30
    const { childrenRef, isVisible } = useElementVisibility({
5✔
31
        element: tableRowRef,
5✔
32
    });
5✔
33

5✔
34
    return (
5✔
35
        <TableResponsiveWrapper ref={tableRowRef}>
5✔
36
            <Table width={"100%"} style={{ borderCollapse: "collapse" }}>
5✔
37
                <Table.Thead>
5✔
38
                    <Table.Tr>
5✔
39
                        <Table.Th>Id</Table.Th>
5✔
40
                        <Table.Th>Owner</Table.Th>
5✔
41
                        <Table.Th>URL</Table.Th>
5✔
42
                        <Table.Th ref={childrenRef}>Data</Table.Th>
5✔
43
                        <Transition
5✔
44
                            mounted={isVisible}
5✔
45
                            transition="scale-x"
5✔
46
                            duration={500}
5✔
47
                            timingFunction="ease-out"
5✔
48
                        >
5✔
49
                            {(styles) => (
5✔
50
                                <th
×
51
                                    style={{
×
52
                                        ...styles,
×
53
                                        position: "sticky",
×
54
                                        top: 0,
×
55
                                        right: 0,
×
56
                                        backgroundColor: bgColor,
×
57
                                        padding:
×
58
                                            "var(--table-vertical-spacing) var(--table-horizontal-spacing, var(--mantine-spacing-lg))",
×
59
                                    }}
×
60
                                >
×
61
                                    Data
×
62
                                </th>
×
63
                            )}
5✔
64
                        </Transition>
5✔
65
                    </Table.Tr>
5✔
66
                </Table.Thead>
5✔
67
                <Table.Tbody>
5✔
68
                    {fetching ? (
5!
69
                        <Table.Tr>
×
70
                            <Table.Td align="center" colSpan={4}>
×
71
                                <Loader />
×
72
                            </Table.Td>
×
73
                        </Table.Tr>
×
74
                    ) : (
5✔
75
                        totalCount === 0 && (
5✔
76
                            <Table.Tr>
5✔
77
                                <Table.Td colSpan={4} align="center">
5✔
78
                                    <Text fw={700}>No applications</Text>
5✔
79
                                </Table.Td>
5✔
80
                            </Table.Tr>
5✔
81
                        )
5✔
82
                    )}
5✔
83
                    {applications.map((application) => (
5✔
84
                        <ApplicationRow
×
85
                            key={application.id}
×
86
                            application={
×
87
                                application as Omit<Application, "inputs">
×
88
                            }
×
89
                            keepDataColVisible={!isVisible}
×
90
                        />
×
91
                    ))}
5✔
92
                </Table.Tbody>
5✔
93
            </Table>
5✔
94
        </TableResponsiveWrapper>
5✔
95
    );
5✔
96
};
5✔
97

1✔
98
export default ApplicationsTable;
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc