-
- {isConnected ? (
- <>
-
- Connected
- >
- ) : (
- <>
-
- Disconnected
- >
- )}
-
-
-
-
- {peerCount} peer{peerCount !== 1 ? 's' : ''}
-
-
- );
-}
diff --git a/frontend/src/components/CreatePoll.tsx b/frontend/src/components/CreatePoll.tsx
deleted file mode 100644
index d7963cb..0000000
--- a/frontend/src/components/CreatePoll.tsx
+++ /dev/null
@@ -1,43 +0,0 @@
-import { useState } from 'react';
-import { Plus } from 'lucide-react';
-
-interface CreatePollProps {
- onCreate: (question: string) => void;
-}
-
-export function CreatePoll({ onCreate }: CreatePollProps) {
- const [question, setQuestion] = useState('');
-
- const handleSubmit = (e: React.FormEvent) => {
- e.preventDefault();
- if (question.trim()) {
- onCreate(question);
- setQuestion('');
- }
- };
-
- return (
-
- {sortedOptions.length === 0 ? (
-
- No options yet. Add one to get started!
-
- ) : (
- sortedOptions.map((option) => {
- const percentage = totalVotes > 0 ? (option.votes / totalVotes) * 100 : 0;
- const userHasVoted = hasVoted ? hasVoted(option) : false;
-
- return (
-
-
-
- {option.text}
- {userHasVoted && β Voted}
-
-
-
-
-
-
-
- by {option.createdBy}
- {percentage.toFixed(1)}%
-
-
- );
- })
- )}
-
- );
-}
diff --git a/frontend/src/components/PollCard.tsx b/frontend/src/components/PollCard.tsx
deleted file mode 100644
index 0d635ca..0000000
--- a/frontend/src/components/PollCard.tsx
+++ /dev/null
@@ -1,50 +0,0 @@
-import { Poll } from '../types/poll.types';
-import { AddOption } from './AddOption';
-import { OptionList } from './OptionList';
-import { User, Clock } from 'lucide-react';
-
-interface PollCardProps {
- poll: Poll;
- onAddOption: (pollId: string, text: string) => void;
- onVote: (pollId: string, optionId: string) => void;
- hasVoted: (option: any) => boolean;
-}
-
-export function PollCard({ poll, onAddOption, onVote, hasVoted }: PollCardProps) {
- const handleAddOption = (text: string) => {
- onAddOption(poll.id, text);
- };
-
- const handleVote = (optionId: string) => {
- onVote(poll.id, optionId);
- };
-
- const formatTime = (timestamp: number) => {
- const date = new Date(timestamp);
- return date.toLocaleString();
- };
-
- return (
-