import { type ExternalPathString, Link } from "expo-router"; import { styles } from "@/styles/components/largeURLView"; import type { APIURL, DashURL } from "@/types/zipline"; import type { URLActions } from "@/app/(app)/urls"; import { timeDifference } from "@/functions/util"; import Dropdown from "@/components/Dropdown"; import { Text, View } from "react-native"; interface Props { url: APIURL; dashUrl: DashURL; urlsRoute: string; onAction: (type: URLActions, url: APIURL) => Promise | void; } export default function LargeURLView({ url, urlsRoute, dashUrl, onAction, }: Props) { return ( {url.enabled ? ( {url.vanity || url.code} ) : ( {url.vanity || url.code} )} { onAction("copyShortLink", url); }, }, { name: "Copy Destination", id: `${url.id}-copyDestinatin`, icon: "content-copy", onPress: async () => { onAction("copyDestination", url); }, }, { name: "Edit", id: `${url.id}-edit`, icon: "edit", onPress: () => { onAction("edit", url); }, }, { name: "Delete", id: `${url.id}-delete`, color: "#e65f59", iconColor: "#e65f59", icon: "delete", onPress: () => { onAction("delete", url); }, }, ]} /> Views: {url.views} Max Views:{" "} {url.maxViews || "Unlimited"} Enabled:{" "} {url.enabled ? "Yes" : "No"} Created:{" "} {timeDifference(new Date(), new Date(url.createdAt))} Updated:{" "} {timeDifference(new Date(), new Date(url.updatedAt))} Destination:{" "} {url.destination} {url.vanity && ( Code:{" "} {url.code} )} ID:{" "} {url.id} ); }