2024-03-06 01:57:59 +08:00
|
|
|
import { Asset } from "@lib/api/assets";
|
2024-03-07 09:09:31 +08:00
|
|
|
import { FormRow } from "@lib/ui/components/discord/Forms";
|
|
|
|
|
import { clipboard } from "@metro/common";
|
2024-03-06 01:57:59 +08:00
|
|
|
import { showToast } from "@ui/toasts";
|
2024-03-07 09:09:31 +08:00
|
|
|
import { Image } from "react-native";
|
2022-10-23 00:38:04 +01:00
|
|
|
|
2024-03-06 01:57:59 +08:00
|
|
|
interface AssetDisplayProps { asset: Asset; }
|
2022-10-23 00:38:04 +01:00
|
|
|
|
|
|
|
|
export default function AssetDisplay({ asset }: AssetDisplayProps) {
|
|
|
|
|
return (
|
|
|
|
|
<FormRow
|
|
|
|
|
label={`${asset.name} - ${asset.id}`}
|
2024-03-07 09:09:31 +08:00
|
|
|
trailing={<Image source={asset.id} style={{ width: 32, height: 32 }} />}
|
2022-10-23 01:37:49 +01:00
|
|
|
onPress={() => {
|
2023-03-20 16:11:27 -04:00
|
|
|
clipboard.setString(asset.name);
|
2023-12-21 12:45:15 +08:00
|
|
|
showToast.showCopyToClipboard();
|
2022-10-23 01:37:49 +01:00
|
|
|
}}
|
2022-10-23 00:38:04 +01:00
|
|
|
/>
|
2024-03-06 01:57:59 +08:00
|
|
|
);
|
|
|
|
|
}
|