initial commit

This commit is contained in:
Sone
2026-05-19 18:46:16 +02:00
parent a92d70ca74
commit 7e67fa8ea0
33 changed files with 6316 additions and 3952 deletions
@@ -31,27 +31,30 @@ export const DesktopLogsTable = ({
{logs.map((log) => (
<DataTable.Row key={log.id}>
<DataTable.Cell>
<View className="flex-row items-center flex-shrink pr-2">
<View className="flex-row items-center shrink pr-2">
<Text numberOfLines={1}>{log.name}</Text>
</View>
</DataTable.Cell>
<DataTable.Cell>
<View className="flex-row items-center flex-shrink pr-2">
<View className="flex-row items-center shrink pr-2">
<Text numberOfLines={1}>{log.email}</Text>
</View>
</DataTable.Cell>
<DataTable.Cell>
<View className="flex-row items-center flex-shrink pr-2">
<View className="flex-row items-center shrink pr-2">
<Text numberOfLines={1}>
{formatDate(log.lastLoginAt)} {formatTimeWithSeconds(log.lastLoginAt)}
{formatDate(log.lastLoginAt)}{" "}
{formatTimeWithSeconds(log.lastLoginAt)}
</Text>
</View>
</DataTable.Cell>
<DataTable.Cell>
<View className="flex-row items-center flex-shrink pr-2">
<View className="flex-row items-center shrink pr-2">
<Text
numberOfLines={1}
style={{ color: log.status === "FAILURE" ? "#F83434" : "#22C927" }}
style={{
color: log.status === "FAILURE" ? "#F83434" : "#22C927",
}}
>
{log.activity}
{log.status === "FAILURE" && reasonLabel(log.failureReason)
+7 -4
View File
@@ -5,7 +5,7 @@ import { formatDate, formatTimeWithSeconds } from "@/utils/dateUtils";
import { reasonLabel } from "@/utils/loginUtils";
interface MobileLogsTableProps {
logs: UserLoginLog[];
logs: UserLoginLog[] | null | undefined;
}
export const MobileLogsTable = ({ logs }: MobileLogsTableProps) => {
@@ -15,18 +15,21 @@ export const MobileLogsTable = ({ logs }: MobileLogsTableProps) => {
className="flex-1"
contentContainerStyle={{ paddingBottom: 16 }}
>
{logs.map((log) => (
{logs?.map((log) => (
<View key={log.id} className="mb-3 p-4 bg-white rounded-md shadow-sm">
<Text className="text-base font-semibold">
{log.name}{" "}
<Text className="font-normal text-gray-600">({log.email})</Text>
</Text>
<Text className="text-sm text-gray-700 mt-1">
Time: {formatDate(log.lastLoginAt)} {formatTimeWithSeconds(log.lastLoginAt)}
Time: {formatDate(log.lastLoginAt)}{" "}
{formatTimeWithSeconds(log.lastLoginAt)}
</Text>
<Text
className="text-sm mt-1"
style={{ color: log.status === "FAILURE" ? "#F83434" : "#22C927" }}
style={{
color: log.status === "FAILURE" ? "#F83434" : "#22C927",
}}
>
Login activity: {log.activity}
{log.status === "FAILURE" && reasonLabel(log.failureReason)