MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / SourceErrors

Function SourceErrors

console/src/platform/sources/SourceErrors.tsx:31–98  ·  view source on GitHub ↗
({ source }: SourceErrorsProps)

Source from the content-addressed store, hash-verified

29}
30
31const SourceErrors = ({ source }: SourceErrorsProps) => {
32 const { colors } = useTheme<MaterializeTheme>();
33 const [timePeriodMinutes, setTimePeriodMinutes] = useTimePeriodMinutes({
34 localStorageKey: "mz-source-errors-time-period",
35 });
36 const [_, startTransition] = React.useTransition();
37
38 const updateTimePeriod = React.useCallback(
39 (value: number) => {
40 startTransition(() => setTimePeriodMinutes(value));
41 },
42 [setTimePeriodMinutes],
43 );
44
45 return (
46 <MainContentContainer>
47 <HStack spacing={6} alignItems="flex-start" flex="1" height="100%">
48 <VStack width="100%" alignItems="flex-start" spacing={6} flex="1">
49 <VStack width="100%" alignItems="flex-start" spacing={6} flex="1">
50 {source?.error && (
51 <Alert variant="error" width="100%" message={source?.error} />
52 )}
53 <Box
54 border={`solid 1px ${colors.border.primary}`}
55 borderRadius="8px"
56 py={4}
57 px={6}
58 width="100%"
59 >
60 <Flex
61 justifyContent="space-between"
62 alignItems="center"
63 width="100%"
64 mb={4}
65 >
66 <Text fontSize="16px" fontWeight="500">
67 Source Errors
68 </Text>
69 <TimePeriodSelect
70 timePeriodMinutes={timePeriodMinutes}
71 setTimePeriodMinutes={updateTimePeriod}
72 />
73 </Flex>
74 <AppErrorBoundary
75 message={SOURCES_FETCH_ERROR_MESSAGE}
76 containerProps={{ height: HEIGHT_PX }}
77 >
78 <SourceErrorsGraph
79 sourceId={source.id}
80 timePeriodMinutes={timePeriodMinutes}
81 />
82 </AppErrorBoundary>
83 </Box>
84 <AppErrorBoundary
85 message={SOURCES_FETCH_ERROR_MESSAGE}
86 containerProps={{ height: HEIGHT_PX }}
87 >
88 <SourceErrorsTable

Callers

nothing calls this directly

Calls 1

useTimePeriodMinutesFunction · 0.90

Tested by

no test coverage detected