import React from 'react';
import { unstable_setRequestLocale } from 'next-intl/server';
import { Link } from '../../../../../../navigation';
import { i18nText } from '../../../../../../i18nKeys';

export function generateStaticParams({
    params: { locale },
}: { params: { locale: string } }) {
    const result: { locale: string, textId: string }[] = [];
    const chats = [{ textId: '1' }, { textId: '2' }, { textId: '3' }];

    chats.forEach(({ textId }) => {
        result.push({ locale, textId });
    });

    return result;
}

export default function Message({ params }: { params: { locale: string, textId: string } }) {
    unstable_setRequestLocale(params.locale);

    return (
        <>
            <ol className="breadcrumb">
                <li className="breadcrumb-item">
                    <Link href={'/account/messages' as any}>
                        {i18nText('accountMenu.messages', params.locale)}
                    </Link>
                </li>
                <li className="breadcrumb-item active" aria-current="page">{`Person ${params.textId}`}</li>
            </ol>

            <div className="b-message">
                <div className="b-message__inner">
                    <div className="b-message__list b-message__list--me">
                        <div className="b-message__item ">
                            <div className="b-message__avatar">
                                <img src="/images/person.png" className="" alt="" />
                            </div>
                            <div className="b-message__text">
                                🤩 It all for you!

                                <span className="date">07.09.2022</span>
                            </div>
                        </div>
                    </div>
                    <div className="b-message__list">
                        <div className="b-message__item">
                            <div className="b-message__avatar">
                                <img src="/images/person.png" className="" alt="" />
                            </div>
                            <div className="b-message__text">
                                🤩 It all for you!
                                <span className="date">07.09.2022</span>
                            </div>
                        </div>
                    </div>
                </div>
                <form className="b-message__form" action="">
                    <textarea placeholder="Type your message here" name="" id="" />
                    <label className="b-message__upload-file">
                        <input type="file" required />
                    </label>
                    <div className="b-message__microphone" />
                    <button className="b-message__btn" type="submit" />
                </form>
            </div>
        </>
    );
};
