GoonCord/src/core/ui/components/AssetDisplay.tsx

21 lines
666 B
TypeScript
Raw Normal View History

2024-03-06 01:57:59 +08:00
import { Asset } from "@lib/api/assets";
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";
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}`}
trailing={<Image source={asset.id} style={{ width: 32, height: 32 }} />}
onPress={() => {
clipboard.setString(asset.name);
2023-12-21 12:45:15 +08:00
showToast.showCopyToClipboard();
}}
2022-10-23 00:38:04 +01:00
/>
2024-03-06 01:57:59 +08:00
);
}