2024-04-23 23:06:19 +02:00
|
|
|
/*
|
|
|
|
|
* Vencord, a Discord client mod
|
|
|
|
|
* Copyright (c) 2024 Vendicated and contributors
|
|
|
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
*/
|
|
|
|
|
|
2025-10-11 01:42:14 +02:00
|
|
|
import { Button } from "@components/Button";
|
2025-11-16 15:17:35 +01:00
|
|
|
import { SessionInfo } from "@plugins/betterSessions/types";
|
2026-05-27 15:50:48 -04:00
|
|
|
import { cl } from "@plugins/betterSessions/utils";
|
2026-05-10 13:58:48 +02:00
|
|
|
import { openModal } from "@webpack/common";
|
2024-04-23 23:06:19 +02:00
|
|
|
|
|
|
|
|
import { RenameModal } from "./RenameModal";
|
|
|
|
|
|
|
|
|
|
export function RenameButton({ session, state }: { session: SessionInfo["session"], state: [string, React.Dispatch<React.SetStateAction<string>>]; }) {
|
|
|
|
|
return (
|
|
|
|
|
<Button
|
2025-10-11 01:42:14 +02:00
|
|
|
variant="secondary"
|
|
|
|
|
size="xs"
|
2026-05-27 15:31:42 -04:00
|
|
|
className={cl("rename-btn")}
|
2024-04-23 23:06:19 +02:00
|
|
|
onClick={() =>
|
|
|
|
|
openModal(props => (
|
|
|
|
|
<RenameModal
|
|
|
|
|
props={props}
|
|
|
|
|
session={session}
|
|
|
|
|
state={state}
|
|
|
|
|
/>
|
|
|
|
|
))
|
|
|
|
|
}
|
|
|
|
|
>
|
|
|
|
|
Rename
|
|
|
|
|
</Button>
|
|
|
|
|
);
|
|
|
|
|
}
|
2026-04-12 15:14:15 -04:00
|
|
|
|
|
|
|
|
export function NewButton() {
|
|
|
|
|
return (
|
|
|
|
|
<Button
|
|
|
|
|
variant="dangerPrimary"
|
|
|
|
|
size="min"
|
2026-05-27 15:31:42 -04:00
|
|
|
className={cl("new-btn")}
|
2026-04-12 15:14:15 -04:00
|
|
|
>
|
|
|
|
|
NEW
|
|
|
|
|
</Button>
|
|
|
|
|
);
|
|
|
|
|
}
|