mirror of
https://github.com/formbricks/formbricks.git
synced 2026-02-05 02:58:36 -06:00
### New Formbricks Release: Complete Rewrite, New Features & Enhanced UI 🚀 We're thrilled to announce the release of the new Formbricks, a complete overhaul of our codebase, packed with powerful features and an improved user experience. #### What's New: 1. **Survey Builder**: Design and customize your in-product micro-surveys with our intuitive survey builder. 2. **Trigger Micro-Surveys**: Set up micro-surveys to appear at specific points within your app, allowing you to gather feedback when it matters most. 3. **JavaScript SDK**: Our new JavaScript SDK makes integration a breeze - just embed it once and you're ready to go. 4. **No-Code Events**: Set up events and triggers without writing a single line of code, making it accessible for everyone on your team. 5. **Revamped UI**: Enjoy an entirely new user interface that enhances usability and provides a smooth, delightful experience. This release marks a major step forward for Formbricks, enabling you to better understand your users and build an outstanding product experience. Please update your Formbricks integration to take advantage of these exciting new features, and let us know in the Discord if you have any questions or feedback! Happy surveying! 🎉
58 lines
1.8 KiB
TypeScript
58 lines
1.8 KiB
TypeScript
import Modal from "@/components/shared/Modal";
|
|
import { useState } from "react";
|
|
|
|
interface ModalWithTabsProps {
|
|
open: boolean;
|
|
setOpen: (v: boolean) => void;
|
|
icon?: React.ReactNode;
|
|
label?: string;
|
|
description?: string;
|
|
tabs: TabProps[];
|
|
}
|
|
|
|
type TabProps = {
|
|
title: string;
|
|
children: React.ReactNode;
|
|
};
|
|
|
|
export default function ModalWithTabs({ open, setOpen, tabs, icon, label, description }: ModalWithTabsProps) {
|
|
const [activeTab, setActiveTab] = useState(0);
|
|
|
|
const handleTabClick = (index: number) => {
|
|
setActiveTab(index);
|
|
};
|
|
|
|
return (
|
|
<Modal open={open} setOpen={setOpen} noPadding>
|
|
<div className="flex h-full flex-col rounded-lg">
|
|
<div className="rounded-t-lg bg-slate-100">
|
|
<div className="flex items-center justify-between p-6">
|
|
<div className="flex items-center space-x-2">
|
|
{icon && <div className="mr-1.5 h-6 w-6 text-slate-500">{icon}</div>}
|
|
<div>
|
|
{label && <div className="text-xl font-medium text-slate-700">{label}</div>}
|
|
{description && <div className="text-sm text-slate-500">{description}</div>}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div className="flex h-full items-center space-x-2 border-b border-slate-200 px-6 ">
|
|
{tabs.map((tab, index) => (
|
|
<button
|
|
key={index}
|
|
className={`mr-4 px-1 pb-3 pt-6 focus:outline-none ${
|
|
activeTab === index
|
|
? "border-brand-dark border-b-2 font-semibold text-slate-900"
|
|
: "text-slate-500 hover:text-slate-700"
|
|
}`}
|
|
onClick={() => handleTabClick(index)}>
|
|
{tab.title}
|
|
</button>
|
|
))}
|
|
</div>
|
|
<div className="flex-1 p-6">{tabs[activeTab].children}</div>
|
|
</div>
|
|
</Modal>
|
|
);
|
|
}
|