/
Home.tsx
36 lines (31 loc) · 956 Bytes
/
Home.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import React, { useState } from 'react';
import { Button, Input } from '@nextui-org/react';
import { useNavigate } from 'react-router-dom';
import { guestSampleId } from '../constants/cdpenv';
const Home: React.FC = () => {
const [inputText, setInputText] = useState('');
const navigate = useNavigate();
const handleButtonClick = () => {
navigate(`/guests/${inputText}`);
};
return (
<>
<div className="mx-auto max-w-2xl text-center">
<h1 className="text-2xl font-bold leading-tight tracking-tight text-gray-900">
Sitecore CDP Profile Viewer
</h1>
<Input
type="text"
value={inputText}
label="Guest ID"
onChange={(e) => setInputText(e.target.value)}
/>
<Button color="primary" onClick={handleButtonClick}>
Check
</Button>
<p>Sample GuestID : {guestSampleId}</p>
</div>
</>
);
};
export default Home;