revite/src/components/common/messaging/embed/EmbedMediaActions.tsx

29 lines
826 B
TypeScript
Raw Normal View History

2021-07-05 06:23:23 -04:00
import { LinkExternal } from "@styled-icons/boxicons-regular";
2021-06-20 17:09:18 -04:00
import { EmbedImage } from "revolt.js/dist/api/objects";
2021-07-05 06:23:23 -04:00
import styles from "./Embed.module.scss";
import IconButton from "../../../ui/IconButton";
2021-06-20 17:09:18 -04:00
interface Props {
2021-07-05 06:25:20 -04:00
embed: EmbedImage;
2021-06-20 17:09:18 -04:00
}
export default function EmbedMediaActions({ embed }: Props) {
2021-07-05 06:25:20 -04:00
const filename = embed.url.split("/").pop();
2021-06-20 17:09:18 -04:00
2021-07-05 06:25:20 -04:00
return (
<div className={styles.actions}>
<span className={styles.filename}>{filename}</span>
<span className={styles.filesize}>
{embed.width + "x" + embed.height}
</span>
<a href={embed.url} class={styles.openIcon} target="_blank">
2021-07-05 06:25:20 -04:00
<IconButton>
<LinkExternal size={24} />
</IconButton>
</a>
</div>
);
2021-06-20 17:09:18 -04:00
}