fixed getting data for completing a survey

This commit is contained in:
Tatiana Nikolaeva 2025-06-02 16:00:19 +05:00
parent 88dcb63232
commit 2ec9354fc1
13 changed files with 128 additions and 55 deletions

View file

@ -18,6 +18,15 @@ const SettingSurvey: React.FC = () => {
const [descriptionSurvey, setDescriptionSurvey] = useState('');
const [titleSurvey, setTitleSurvey] = useState('');
const handleCopyLink = () => {
if (!survey?.id)
return;
const link = `${window.location.origin}/complete-survey/${survey.id}`;
navigator.clipboard.writeText(link)
.then(() => console.log('Copied!'))
.catch(error => console.error(`Не удалось скопировать ссылку: ${error}`));
}
return (
<div className={styles.settingSurvey}>
{isSettingCreatePage ? (
@ -43,6 +52,7 @@ const SettingSurvey: React.FC = () => {
<h2>Параметры видимости</h2>
</div>
<SaveButton onClick={() => {}}/>
<button onClick={handleCopyLink} className={styles.copyButton}>Копировать ссылку</button>
</div>
)
}