Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { React, useEffect, useState } from 'react';
- import { useRouter } from 'next/router';
- import 'bootstrap/dist/css/bootstrap.min.css';
- import PocketBase from 'pocketbase';
- const pb = new PocketBase('http://127.0.0.1:8090');
- let url = 'http://127.0.0.1:8090';
- function BlogId() {
- const fetchData = async (id) => {
- const record = await pb.collection('tourpackages').getOne(`${id}`, {
- expand: 'relField1,relField2.subRelField',
- });
- console.log(record);
- if (record) {
- return record;
- } else {
- console.log('No record found');
- }
- };
- const router = useRouter();
- const [packages, setPackages] = useState([]);
- const blogNo = router.query.blogId;
- console.log(blogNo);
- useEffect(() => {
- if (blogNo) {
- const data = fetchData(blogNo);
- console.log(data);
- setPackages(data);
- }
- }, [blogNo]);
- return (
- <div>
- <h4>Blog-1</h4>
- <div>
- <div className='blog-container d-flex justify-content-center'>
- <div className='row'>
- <div className='bg-success p-2 text-dark bg-opacity-10'>
- <div className='d-grid justify-content-center'>
- <div className='p-1 mb-1 bg-success text-white'></div>
- <div className='card col col-lg-4 col-md-6 col-12'>
- <img src='pic1.jpg' className='card-img-top' alt='...' />
- <div className='card-body'>
- <h1>
- <b>{packages.title}</b>
- </h1>
- <p className='card-text'>
- বাংলাদেশ দর্শনীয় স্থানগুলোর মধ্যে সুন্দরবনের স্থান সবার
- উপরে। হাজারো বিদেশি পর্যটকের বাংলাদেশ ভ্রমণের প্রধান
- আকর্ষণ সুন্দরবন। পৃথিবীর সবচাইতে বড় ও এই জল বনে প্রায়
- ১০০০০ বর্গ কিলোমিটার যার প্রায় ৬০% বাংলাদেশে অবস্থিত।
- বাংলাদেশের সুন্দরবন ঘনবসতিপূর্ণ ছিল সবচাইতে বন। সুন্দরী,
- গরান, গাওয়া গাছ আর মানুষ খেকো রয়্যাল বেঙ্গল টাইগার খ্যাত
- এই বনে, প্রতিমুহূর্ত যেন দুঃসাহসিক রোমাঞ্চ। সুন্দরবনে আছে
- ২৪৫ ধরনের পাখি আর ট্যুরে হরিণ, বুনো শুয়র, নানান প্রজাতির
- সাপ দেখা মিলে সহজেই। শীতের সকালে নাস্তা খেতে খেতে, কুমিরের
- রোদ পোহানো দৃশ্য দেখতে পাওয়াটাও কিন্তু এককথায় অনন্য
- সাধারণ।
- </p>
- </div>
- <img src='pic2.jpg' className='card-img-top' alt='...' />
- <div className='card-body'>
- <p className='card-text'>
- Some quick example text to build on the card title and
- make up the bulk of the cards content.
- </p>
- </div>
- <img src='pic3.jpg' className='card-img-top' alt='...' />
- <div className='card-body'>
- <p className='card-text'>
- Some quick example text to build on the card title and
- make up the bulk of the cards content.
- </p>
- </div>
- <img src='pic4.jpg' className='card-img-top' alt='...' />
- <div className='card-body'>
- <p className='card-text'>
- Some quick example text to build on the card title and
- make up the bulk of the cards content.
- </p>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- ;
- </div>
- );
- }
- export default BlogId;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement